objects in memory

gregory.menke at gsfc.nasa.gov gregory.menke at gsfc.nasa.gov
Thu Mar 20 22:33:19 UTC 2003


Angelo Fraietta writes:
 > Salman wrote:
 > 
 > >Does user have any control over the placement of an object in memory,
 > >upon creation ?
 > >
 > >for example: is it possible for me to state that I want a task, object
 > >or semaphore to be created at a specific physical memory location (eg
 > >0x0010000) ??
 > >
 > >thanks,
 > >
 > >Salman
 > >
 > >
 > Yes, to some degree. In C++, you can overload operator new on a class 
 > which will retun whatever you want it to.
 > In those instances, calling new to create an object does not have to 
 > give you memory from the free store, but rather, whatever you program 
 > operator new to return.
 > BTW, you also have to overload operator delete for those classes if you 
 > overload operator new.
 > Also. you only have to overload new and delete on for classes you want to.
 > 

I think he's talking about creating workspace objects at particular
addresses.  The link script will likely lay out an address range for
workspace, so you can be sure the control structure will end up
somewhere in there.  Or, if your're on a bsp that combines heap and
workspace, things can be more complex.  I think exact control of
object placement beyond that isn't very feasible (and probably not all
that desirable either).

Gregm





More information about the users mailing list