🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #2734

Re: STL allocator spec broken?

#2734
From: Steve Clamage
Date: Tue, 28 Nov 1995 23:49
25 lines
1258 bytes
In article fsf@marsh.cacs.usl.edu, akv@cacs.usl.edu (Anil Vijendran) writes:

>I have a question in relation to this... I've seen persistence
>systems/libraries where the allocator or the heap itself is passed
>using the placement syntax... for example,

>	ptr = new (pstore) shape;

>I have always been wondering how the constructor of the class could
>allocate its data members on the same heap the top level object was
>placed in.

Give the constructor an additional parameter:

	ptr = new (pstore) shape(pstore); // or whatever
---
Steve Clamage, stephen.clamage@eng.sun.com



---
[ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy
  is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID: <49g2mh$p7f@engnews1.eng.sun.com>
Path: arc1-ca.pugleaf.net!128.32.155.1!matt
References: <xg3ohtwl6t0.fsf@marsh.cacs.usl.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!128.32.155.1!matt
From: clamage@Eng.Sun.COM (Steve Clamage)
Newsgroups: comp.std.c++
Subject: Re: STL allocator spec broken?
Date: 28 Nov 1995 23:49:49 GMT
Organization: Sun Microsystems Inc.
Approved: matt@physics2.Berkeley.EDU (Matt Austern)
Message-ID: <49g2mh$p7f@engnews1.eng.sun.com>
References: <xg3ohtwl6t0.fsf@marsh.cacs.usl.edu>
Reply-To: clamage@Eng.Sun.COM
NNTP-Posting-Host: physics2.berkeley.edu