Solved

Contiguous Memory Allocation

Posted on 2001-06-29
3
5,788 Views
Last Modified: 2013-12-03
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).
0
Comment
Question by:Chandra V
3 Comments
 
LVL 5

Expert Comment

by:robpitt
ID: 6238329
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
 
LVL 32

Accepted Solution

by:
jhance earned 50 total points
ID: 6242977
>>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
 
LVL 7

Expert Comment

by:peterchen092700
ID: 6256787
I'm yet another guy with the same question: why do you want to do this?

0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now