Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Question on use of "placement" new

Reply
Thread Tools

Question on use of "placement" new

 
 
Ian Collins
Guest
Posts: n/a
 
      05-19-2008
Frank Birbacher wrote:
> Hi!
>
> Ian Collins schrieb:
>> You don't need boost for that, all you have to do is provide an
>> appropriate allocator to manage a memory pool in shared memory.

>
> Right. My point was: it works, you can use vectors in shared memory. The
> OP seems to oppose to this solution. I cannot agree on some fragile
> solution using the variable-sized-object-and-int[]-hack (which is
> illegal in C++) when there is a cleaner solution (using a vector with
> shmem alloc).
>

I agree. The only real taboos with hared memory objects are static data
members and virtual functions.

--
Ian Collins.
 
Reply With Quote
 
 
 
 
peter koch
Guest
Posts: n/a
 
      05-19-2008
On 19 Maj, 01:01, Ian Collins <(E-Mail Removed)> wrote:
> Frank Birbacher wrote:
> > Hi!

>
> > Paavo Helde schrieb:
> >> I guess with this you meant to say that e.g. std::vector is outlawed.

>
> > Well, boost allows vectors, maps, and other stuff in shared memory:
> >http://www.boost.org/doc/libs/1_35_0...ess/quick_guid...

>
> You don't need boost for that, all you have to do is provide an
> appropriate allocator to manage a memory pool in shared memory.


This requires the memory pool to have the same adress in every
process. Apparantly this is not the case for the OP.

/Peter
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Javascript new-new-new-new-newbee weblinkunlimited@gmail.com Javascript 2 03-11-2008 01:15 AM
why people use "Map m= new HashMap()" or "List l = new ArrayList()"? www Java 30 10-23-2007 02:55 AM
[Firefox] Use New Tab instead of New Window? paul j Firefox 7 04-07-2005 09:40 PM
How to use an asp:button to create a new browser window and output contents to new window =?Utf-8?B?Tm92aWNl?= ASP .Net 2 06-09-2004 10:54 PM
I am adding a new row to the datagrid dynamically but if i use the Count property of Item it is not showing the count of the new rows being added Praveen Balanagendra via .NET 247 ASP .Net 2 06-06-2004 07:16 AM



Advertisments