shared memory object classes

New Message Reply Date view Thread view Subject view Author view

Lance R. Marrou (marrou++at++vsl.ist.ucf.edu)
Fri, 24 Feb 1995 15:47:21 -0500 (EST)


I am curious if it is possible to use the operator new to allocate an object
class in shared memory. I tried most (if not all) combinations like:

    po = ::new(sizeof(printobj),pfGetSharedArena()) printobj();
    po = new(sizeof(printobj),pfGetSharedArena()) printobj();
    po = new(pfGetSharedArena()) printobj();

These were just some simple test cases, I have much more complicated classes
in mind. What seems to work is this:

  po = (printobj *)pfMalloc(sizeof(printobj),pfGetSharedArena());

But then I need a fake constructor to call after allocation.

______________________________________________________________________________
           /\ ______ /\____ ______ ______ E-mail: marrou++at++vsl.ist.ucf.edu
Visual / / / _ / / __ // ____// ____/ VSL: (407)658-5073
Systems / /__ / /_/ / / / / // /___ / __/_ R. Marrou Fax: (407)658-5059
Lab /____//____/\\/_/ /_//_____//_____/ http://www.vsl.ist.ucf.edu/~marrou
"Reap the whirlwind." "We don't need no thought control."


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:51:00 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.