From: Florian Weimer <fw@deneb.enyo.de>
Subject: Re: Emulating placement new
Date: Sun, 29 Jul 2012 16:15:01 +0200
Date: 2012-07-29T16:15:01+02:00 [thread overview]
Message-ID: <87pq7e7ixm.fsf@mid.deneb.enyo.de> (raw)
In-Reply-To: 5j0ucqxb38j$.6c4x5hrz3wmw.dlg@40tude.net
* Dmitry A. Kazakov:
> On Sun, 29 Jul 2012 15:56:27 +0200, Florian Weimer wrote:
>
>> Is there a way to specify a storage pool (or something similar) on the
>> allocator, and not on the access type?
> Maybe something like this:
>
> function Allocate_In (Pool : in out Root_Storage_Pool'Class)
> return not null access T is
> type T_Ptr is access T;
> for T_Ptr'Storage_Pool use Pool;
> Ptr : T_Ptr;
> begin
> Ptr := new T;
> return Ptr.all'Unchecked_Access;
> end Allocate_In;
This doesn't work for unconstrained types.
next prev parent reply other threads:[~2012-08-06 16:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-29 13:56 Emulating placement new Florian Weimer
2012-07-29 14:10 ` Dmitry A. Kazakov
2012-07-29 14:15 ` Florian Weimer [this message]
2012-07-29 14:25 ` Dmitry A. Kazakov
2012-07-29 15:00 ` Georg Bauhaus
2012-07-29 16:04 ` Robert A Duff
2012-07-29 18:48 ` Florian Weimer
2012-07-29 19:14 ` Robert A Duff
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox