Revision [202]
This is an old revision of sqGrowMemoryBy made by JohnMcIntosh on 2008-10-17 01:09:55.
sqInt sqGrowMemoryBy(sqInt oldLimit, sqInt delta)
Parms:
oldLimit current end of oops memory limit
delta how much to grow by
return: new limit, or old limit if failure
From: Interpreter
Why:
To grow the oops space
Responsibility:
This logic comes from windows, in the distant pass memory was allocated from oops space on 68000 based macintoshs out of the total
amount of memory available to the application. So if you set Squeak to 16MB then you got oh say 14MB of oops space. Noting that this was adjusted by a reservedHeapAmount to leave room to load plugins. However on more modern systems you could allocate 16MB of memory and then change that segment size either up or down (maybe) Certainly always shrink it which might make the operating system happy. So on windows this Vm change was done where you could slide up or down the allocated amount of memory for the VM.
MacIntosh
os-9/OSXCarbon
Just slide the pointer upwards until we reach gMaxHeapSize which is set by the info.plist (512MB default)
Cocoa:
TBD
iPhone
Just slide the pointer upwards until we reach gMaxHeapSize which is set by the Setting pane slider. (32mb default)
Unix
may use mmap to remap the memory size * Unclear if this actually happens *
Windows
Use VirtualAlloc to ask for more memory, if it fails return the old limit
BUGS