This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Best way to resize a VirtualAlloc block?


Best way to resize a VirtualAlloc block?

Postby kornalius » Apr 8, 2004 @ 6:53pm

I want to be able to resize a memory block allocated with VirtualAlloc. I would like this block to dynamicly grow with the demand. :D

Regards,
Kornalius
User avatar
kornalius
pm Member
 
Posts: 1704
Joined: Dec 9, 2003 @ 6:04pm
Location: Montreal, Québec, Canada


Postby refractor » Apr 8, 2004 @ 7:20pm

Look at the MEM_RESERVE flag.

Really I think you should reserve one large block of virtual address space, then commit it as you use it (mark the pages as PAGE_GUARD) using VirtualProtect.

<a href="http://msdn.microsoft.com/library/en-us/memory/base/creating_guard_pages.asp">This should help</a>
User avatar
refractor
pm Insider
 
Posts: 2304
Joined: Feb 5, 2002 @ 1:12pm
Location: Luxembourg


Postby kornalius » Apr 9, 2004 @ 5:45pm

User avatar
kornalius
pm Member
 
Posts: 1704
Joined: Dec 9, 2003 @ 6:04pm
Location: Montreal, Québec, Canada


Return to Windows Mobile


Sort


Forum Description

A discussion forum for mobile device developers on the Windows Mobile platform. Any platform specific topics are welcome.

Moderators:

Dan East, sponge, Digby, David Horn, Kevin Gelso, RICoder

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum