Hi,


I'm trying to get a feel for when to allocate a movable or a nonmovable memory chunk. The Palm OS Companion says this: "Applications need to store data in movable chunks whenever feasible, thereby enabling the Memory Manager to move chunks as necessary to create contiguous free space in memory for allocation requests."

The advice is clear enough. However, I want to use C++ classes in my
application and the problem is that if you instantiate a class using
the <new> operator you allocate a nonmovable chunk of memory. (You obtain a pointer when using <new>, similar to MemPtrNew(), so the chunk must be nonmovable.)


MyClass *obj = new MyClass(); // Pointer to nonmovable chunk

As far as I can see, using C++ classes, and specifically the <new> operator, automatically causes your application to use memory in a less flexible manner. So should I think twice before using classes in my application? Are nonmovable chunks really bad to use?


Thanks -Laurens


-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/

Reply via email to