Click here to Skip to main content
15,921,203 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: client/serveur mailslot Pin
Hamid_RT4-Jan-07 18:05
Hamid_RT4-Jan-07 18:05 
QuestionHow CALLBACK function work Pin
Max++4-Jan-07 4:16
Max++4-Jan-07 4:16 
AnswerRe: How CALLBACK function work Pin
James R. Twine4-Jan-07 4:25
James R. Twine4-Jan-07 4:25 
Questionmemory allocation using new operator Pin
vikramlinux4-Jan-07 3:59
vikramlinux4-Jan-07 3:59 
AnswerRe: memory allocation using new operator Pin
Jörgen Sigvardsson4-Jan-07 4:17
Jörgen Sigvardsson4-Jan-07 4:17 
GeneralRe: memory allocation using new operator [modified] Pin
vikramlinux4-Jan-07 4:20
vikramlinux4-Jan-07 4:20 
GeneralRe: memory allocation using new operator Pin
James R. Twine4-Jan-07 4:28
James R. Twine4-Jan-07 4:28 
GeneralRe: memory allocation using new operator Pin
Jörgen Sigvardsson4-Jan-07 4:31
Jörgen Sigvardsson4-Jan-07 4:31 
I must admit that I misread your question at first. I thought you wanted physical addresses as opposed to virtual addresses.

vikrams wrote:
So I meant to day that when I request for the memory from where the OS gives me memory by reserving the space from actual Main memory or from page file?


Malloc and new, will use your process local heap, which will just ask the kernel for a chunk of memory every now and then. It's up the OS to decide where your chunk of memory will actually reside - it will try to be as efficient as possible.

Functions like VirtualAlloc() allows you to specify that you must be given physical memory. I suppose that misusing this function may render the system unusable though. It depends on how strong the contract between the caller and the kernel is. If the kernel comes to the conclusion that "I really really really have to swap these pages out to disk now!" and you have specified MEM_PHYSICAL, the outcome can be one of two: it keeps the promise it gave with VirtualAlloc() or it silently moves your physical pages to disk despite your requirements. Maybe someone here in the forum could explain more about such memory allocations. You could always google for VirtualAlloc() and see if there are any articles out there describing the details about allocating physical memory pages.

I recommend checking out Old New Thing[^]. I'm sure that blog has covered allocating memory using this function. Smile | :)



--
Verletzen zerfetzen zersetzen zerstören
Doch es darf nicht mir gehören
Ich muss zerstören

GeneralRe: memory allocation using new operator Pin
vikramlinux4-Jan-07 18:28
vikramlinux4-Jan-07 18:28 
GeneralRe: memory allocation using new operator Pin
Jörgen Sigvardsson5-Jan-07 2:15
Jörgen Sigvardsson5-Jan-07 2:15 
QuestionPrivate Access Pin
Shouvik Das4-Jan-07 3:54
Shouvik Das4-Jan-07 3:54 
AnswerRe: Private Access Pin
Jörgen Sigvardsson4-Jan-07 4:20
Jörgen Sigvardsson4-Jan-07 4:20 
GeneralRe: Private Access Pin
Shouvik Das4-Jan-07 16:37
Shouvik Das4-Jan-07 16:37 
GeneralRe: Private Access Pin
Shouvik Das4-Jan-07 18:44
Shouvik Das4-Jan-07 18:44 
GeneralRe: Private Access Pin
Shouvik Das4-Jan-07 19:28
Shouvik Das4-Jan-07 19:28 
GeneralRe: Private Access Pin
Shouvik Das4-Jan-07 19:31
Shouvik Das4-Jan-07 19:31 
GeneralRe: Private Access Pin
Jörgen Sigvardsson5-Jan-07 2:19
Jörgen Sigvardsson5-Jan-07 2:19 
GeneralRe: Private Access Pin
Shouvik Das5-Jan-07 16:30
Shouvik Das5-Jan-07 16:30 
QuestionCOM exe registration ? Pin
Sakthiu4-Jan-07 3:52
Sakthiu4-Jan-07 3:52 
AnswerRe: COM exe registration ? Pin
James R. Twine4-Jan-07 4:21
James R. Twine4-Jan-07 4:21 
AnswerRe: COM exe registration ? Pin
Sumesh V.V4-Jan-07 17:04
Sumesh V.V4-Jan-07 17:04 
QuestionGDI Objects [modified] Pin
BlitzPackage4-Jan-07 2:59
BlitzPackage4-Jan-07 2:59 
AnswerRe: GDI Objects Pin
Mark Salsbery4-Jan-07 5:26
Mark Salsbery4-Jan-07 5:26 
GeneralRe: GDI Objects Pin
BlitzPackage4-Jan-07 5:28
BlitzPackage4-Jan-07 5:28 
GeneralRe: GDI Objects Pin
Mark Salsbery4-Jan-07 6:14
Mark Salsbery4-Jan-07 6:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.