Pergunta

I am trying to allocate a 3rd party class (not written by me) in shared memory segment.

Dont know how is implemented this class but it may contain another "new", "malloc" calls to allocate memory for its needs.

Does it mean that this new memory will not be allocated inside the shared memory segment and will use standard heap - as a result forked processes will cause segmentation fault accessing functions of this class?

Foi útil?

Solução

Does it mean that this new memory will not be allocated inside the shared memory segment and will use standard heap - as a result forked processes will cause segmentation fault accessing functions of this class?

Right. If the other class allocates it's own stuff using new, then that stuff won't be in your placement-new buffer.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top