Difference between revisions of "LlGetFreeMemory"
Jump to navigation
Jump to search
Line 7: | Line 7: | ||
|return_text=that is the available free space for the current script. | |return_text=that is the available free space for the current script. | ||
|spec | |spec | ||
|caveats=*The function | |caveats=*The return of this function can be wrong. | ||
**[[User:TxMasterG Ping/llGetFreeMemory|Example]] | **[[User:TxMasterG Ping/llGetFreeMemory|Example]] | ||
|constants | |constants |
Revision as of 17:45, 16 April 2007
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
Summary
Function: integer llGetFreeMemory( );225 | Function ID |
0.0 | Forced Delay |
10.0 | Energy |
Returns an integer that is the available free space for the current script.
BUG: Instead of returning the free space it returns the amount of free space that has never been allocated by the heap (historic lowest heap pointer minus the stack end pointer). This means that the heap will appear to never shrink in size (when in fact it does grow and shrink to fill the free space).
Caveats
Examples
// To show usage of memory by a script, take the free memory from 16k llOwnerSay("Script uses " + (string)((16384 - llGetFreeMemory())/1024) + " kBytes");
Notes
Because of the implementation of this function it's usefulness is limited. It has been stated that when the LSL VM is moved to Mono that this function will work properly.