From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,18f3577df8d90927 X-Google-Attributes: gid103376,public From: Samuel Tardieu Subject: Re: Q: How to do memory access with gnat Date: 1997/07/20 Message-ID: #1/1 X-Deja-AN: 257835409 Sender: tardieu@esmeralda.enst.fr References: Mail-Copies-To: sam@ada.eu.org To: "Michael Erdmann" Organization: TELECOM Paris Newsgroups: comp.lang.ada Date: 1997-07-20T00:00:00+00:00 List-Id: >>>>> "Michael" == Michael Erdmann writes: Michael> In Ada95 i am not able to copy data from an Ada object into a Michael> some external memory. Any idea ? You should try using the predefined generic package System.Address_To_Access_Conversions. Then given a variable of type System.Address, you can obtain an access value on your shared data. Pseudo example: with Dos_Utils; with System.Address_To_Access_Conversions; procedure Test is type My_Data is record [...] end record; package A_To_A is new System.Address_To_Access_Conversions (My_Data); subtype My_Data_Access is A_To_A.Object_Pointer; Addr : System.Address; Data : My_Data_Access; begin Addr := Dos_Utils.Get_Shared_Memory (Data'Size / 8); Data := A_To_A.To_Pointer (Addr); [...you can use Data, it is pointing on an object stored in shared mem...] end Test; Sam -- Samuel Tardieu -- sam@ada.eu.org