comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen_leake@stephe-leake.org>
Subject: Re: Address of an object
Date: Mon, 18 Sep 2006 06:29:24 -0400
Date: 2006-09-18T06:29:24-04:00	[thread overview]
Message-ID: <uy7sho4cb.fsf@stephe-leake.org> (raw)
In-Reply-To: 1i3ne95psolai.abl9eureg5t9$.dlg@40tude.net

"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> 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



  reply	other threads:[~2006-09-18 10:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-15 20:24 Address of an object Dmitry A. Kazakov
2006-09-15 23:31 ` Adam Beneschan
2006-09-16  8:13   ` Dmitry A. Kazakov
2006-09-18 10:29     ` Stephen Leake [this message]
2006-09-18 12:09       ` Dmitry A. Kazakov
2006-09-18 13:54         ` Maciej Sobczak
2006-09-18 14:53           ` Dmitry A. Kazakov
2006-09-19  9:15         ` Stephen Leake
2006-09-19 13:29           ` Dmitry A. Kazakov
2006-09-16 13:21 ` Stephen Leake
2006-09-16 17:06   ` Dmitry A. Kazakov
2006-09-20  0:43     ` Randy Brukardt
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox