comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Emulating placement new
Date: Sun, 29 Jul 2012 16:25:22 +0200
Date: 2012-07-29T16:25:22+02:00	[thread overview]
Message-ID: <dsnd1b1cbj1o$.13u5k454iodyf.dlg@40tude.net> (raw)
In-Reply-To: 87pq7e7ixm.fsf@mid.deneb.enyo.de

On Sun, 29 Jul 2012 16:15:01 +0200, Florian Weimer wrote:

> * 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.

Why?

   Ptr := new T (discriminants);

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



  reply	other threads:[~2012-08-06 14:19 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
2012-07-29 14:25     ` Dmitry A. Kazakov [this message]
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