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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,a9026b81108642ee X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!news.glorb.com!atl-c08.usenetserver.com!news.usenetserver.com!pc03.usenetserver.com!news.flashnewsgroups.com-b7.4zTQh5tI3A!not-for-mail Newsgroups: comp.lang.ada Subject: Re: Address of an object References: <382nx7mt637x$.6hjqgb4zxzss.dlg@40tude.net> <1158363114.393740.59040@h48g2000cwc.googlegroups.com> <1i3ne95psolai.abl9eureg5t9$.dlg@40tude.net> From: Stephen Leake Date: Mon, 18 Sep 2006 06:29:24 -0400 Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (windows-nt) Cancel-Lock: sha1:YyBwq0yNwPqzvE7TNcxURY4ooqs= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@flashnewsgroups.com Organization: FlashNewsgroups.com X-Trace: 3be94450e7505759e00d400841 Xref: g2news2.google.com comp.lang.ada:6629 Date: 2006-09-18T06:29:24-04:00 List-Id: "Dmitry A. Kazakov" writes: > Let P be a pointer to X. Then what I need is the address A, which the pool > P'Storage_Pool returned when X was allocated there. This is the same > address the pool will receive upon freeing X. > > ---------- > The problem behind. What I need is to be able to add some dopes to the > objects allocated in *my* pool. new T calls to the pool's Allocate, but the > address it returns gets mangled by the compiler, when converted to the > pointer P [for example, when T is String]. So, having P I cannot get at my > dope. Its address should be > > A = P.all'Address - Offs > > where Offs is known, alas, to the compiler only. The compiler must know > that, otherwise it couldn't pass that to Deallocate. So you want access to some compiler-dependent information; clearly the method will be compiler-dependent, since it isn't defined by the language. What are you going to do with the "dopes" you add? They won't be visible from Ada. -- -- Stephe