Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RAM question

Status
Not open for further replies.

Kherozen

Programmer
Jun 5, 2003
129
CA
Hi,
I'm currently working on a program that need to hold specific address in memory and to be sure that it will never be swap by the OS for another process and the solution of doing a while(true) to hold the process is not a working solution here ...
so I want to know how can I reserve and lock memory addresses in C++,

thanks



jul ^_^
"Computer Science is no more about computers than astronomy is about telescopes"
E. W. Dijkstra.
 
any memory address are you using is not used by other processes on any win32 and unix operation systems, because the RAM and registry are virtual for each process. If you want to use an address, alloc memory by using new/delete, or C functions malloc|calloc|realloc/free.
for example

void* x = (void*)new char[100];
//you marked 100 bytes as allocated
cout<< &quot;allocated address = &quot;<< (int) x<< endl;

delete[] x;
//you marked 100 bytes as free

Ion Filipski
1c.bmp

ICQ: 95034075
AIM: IonFilipski
filipski@excite.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top