ReAllocateMemory-WinXP~Win98(PB4/3.94)

Just starting out? Need help? Post your questions and find answers here.
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

Can you not use VirtualAlloc() for all memory areas?
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

No, as each page is rounded to 64k, so a 20 bytes memory will requiers 64k.
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

I see, thank you. :)
Dummy
Enthusiast
Enthusiast
Posts: 162
Joined: Wed Jun 09, 2004 11:10 am
Location: Germany
Contact:

Post by Dummy »

As the Size of a Memoryblock is saved anyways in PBv4 you could simply set a Memory mark like 2mb:
memorySize < 2mb: heap
memorySize > 2mb: virtual
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

That's what i told in a previous post, but it could take up to 16 bytes per block to keep the memory 16 bytes aligned.
Post Reply