Contiguous Memory Allocation

Is there any API available in windows which allow you to allocate a fixed block of memory(say 100K) contiguously in RAM and reserve it for me(i.e, No data movement and virtual memory management).
LVL 2
Chandra VConsultantAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
jhanceConnect With a Mentor Commented:
>>If what your really trying to do is allocate non-paged memory then the short answer is "NO, you can't
do this".

True for a user program.  If you really need to do this, the place to accomplish it is in a DEVICE DRIVER using the DDK.  

I guess my question is why do you want to do this?  If it's for the typical reason, i.e. supporting a hardware device, then you should be writing a device driver anyway.
0
 
robpittCommented:
Maybe - it depends on what you mean.

A memory page (which is 4K) can be in one of three states
1) Free.
2) Reserved for your use.
3) Commited to storage.

This is controlled via the VirtualAlloc/VirtualFree functions (Search MSDN for details).


*however*


If what your really trying to do is allocate non-paged memory then the short answer is "NO, you can't do this".

0
 
peterchen092700Commented:
I'm yet another guy with the same question: why do you want to do this?

0
All Courses

From novice to tech pro — start learning today.