Boost logo

Boost Users :

Subject: [Boost-users] boost:interprocess sizeof(list<Type>::Node)
From: waterbed (gaston.azerty_at_[hidden])
Date: 2009-03-04 12:28:37


My problem is really basic :
I have N objects of type Type to store in a boost::interprocess::list<Type>.
The question is easy : How many bytes should I provide to the
managed_mapped_file, in order it fits correctly?

So, I supposed I had to store (let's assume bi = boost::interprocess):
  + The list allocator : sizeof( bi::allocator<Type,
bi::managed_shared_memory::segment_manager> )
  + The struct of the list itself : sizeof( bi::list<Type,
bi::allocator<Type, ...> > )
  + The N nodes of the list containing each one of my objects : sizeof(
bi::list<Type, ...>::Node)

First issue : bi::list<Type, ...>::Node is private. Fine, I changed it as
Second issue : sizeof(bi::list<Type, ...>::Node) was not enough, actually I
can't add N objets, I was just able to allocate (N - x) objets
Third issue : so I tried to fix the value of x, but x is not constant, it
changes according to N...

Thus I think, I made a mistake but where? or I forgot something but what?

Thank for your help and your advises.

View this message in context:
Sent from the Boost - Users mailing list archive at

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at