objects in memory

Angelo Fraietta angelo_f at bigpond.com
Thu Mar 20 21:05:37 UTC 2003


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.

Is this any help to you?

-- 
Angelo Fraietta

PO Box 859
Hamilton NSW 2303

Home Page


http://www.users.bigpond.com/angelo_f/

There are those who seek knowledge for the sake of knowledge - that is CURIOSITY
There are those who seek knowledge to be known by others - that is VANITY
There are those who seek knowledge in order to serve - that is LOVE
    Bernard of Clairvaux (1090 - 1153)







More information about the users mailing list