Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Contiguous Memory Allocation

Posted on 2001-06-29
3
Medium Priority
?
5,809 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 150 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

772 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