Wiki source for sqShrinkMemoryBy


Show raw source

======**sqInt sqShrinkMemoryBy(sqInt oldLimit, sqInt delta)**======

**Parms**:
oldLimit current end of oops memory limit
delta how much to shrink by
**return**: new limit, or old limit if failure
**From**: Interpreter
**Why**:
To shrink the oops space

**Responsibility**:
This logic comes from windows

**MacIntosh**
//os-9/OSXCarbon//
Just slide the pointer downwards, exploit sqGrowMemoryBy using a negative number

//Cocoa://
See iPhone

**iPhone**
Just slide the pointer downwards, exploit sqGrowMemoryBy using a negative number

**Unix**
may use mmap to remap the memory size, but this is unlikely since that logic is turned off by default, otherwise
Just slide the pointer downwards

**Windows**
Use VirtualFree to free memory, if it fails return the old limit

**BUGS**

Valid XHTML :: Valid CSS: :: Powered by WikkaWiki