Hi guys
i need a bit help on virtual alloc functions. I´m looking for a routine or library that can be able to handle huge virtual memory, because the ones i´m implementing from RosAsm are crashing badly due to fragmented memory blocks, i guess.
The problem is for the newer pdbdumper i´m making. When it loads a file with let´s say 6 Mb, the virtualloc is ok even if i double the size (or mul by 4) with:
mov eax D@FileSize | shl eax 2 | Align_On MEM_ALIGNMENT eax
call 'RosMem.VMemAlloc' D@pOutput, eax
This is ok, since internally, VMemAlloc uses VirtualAlloc to reserve and commit the necessary pages.
But...when i load a file pdb with 22 Mb, the app simply crashes, because VMemAlloc allocated the necessary size, but as far i saw, the allocated memory is not entirely commited, causing the parser for pdb crash when it tries to access a certain address in virtualmemory.
If needed, i can post here, the functions used internally in VMemAlloc, but i would like to know 1st, if it do exists a library or routines that can handle the necessary memory for huge apps (Allocate, free and reallocate huge memory blocks). Something like what hexworkshop does, i mean, you can open a file with whatever size and it will still load it without crash.
Btw, i don´t need a growable memory. All i was thinking in something simple. I mean, allocate XXX Mb of memory at once and use it according and later free it when it is no longer needed.