gc.monkey2 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. Namespace monkey.gc
  2. Extern
  3. #rem monkeydoc @hidden
  4. #end
  5. Function GCSetDebug( debug:Bool )="bbGC::setDebug"
  6. #rem monkeydoc Sets garbage collection trigger value.
  7. The GC trigger is the number of bytes of memory that must be allocated before a garbage collection is automatically performed.
  8. By default, the GC trigger is set to 4 megabytes.
  9. #end
  10. Function GCSetTrigger:Void( trigger:ULong )="bbGC::setTrigger"
  11. #rem monkeydoc Performs a garbage collection.
  12. Marks all unused memory as 'garbage' and makes it available for reuse in the future.
  13. You should not generally need to use this method as garbage collection is performed automatically.
  14. However, it can be useful when debugging a program for memory leaks to force a garbage collection to run.
  15. #end
  16. Function GCCollect:Void()="bbGC::collect"
  17. #rem monkeydoc Suspends garbage collection.
  18. Causes garbage collection to be suspended.
  19. The number of GCSuspends and GCResumes executed must match for garbage collection to be enabled.
  20. #end
  21. Function GCSuspend:Void()="bbGC::suspend"
  22. #rem monkeydoc Resumes garbagecollection.
  23. Causes garbage collection to be resumed.
  24. The number of GCSuspends and GCResumes executed must match for garbage collection to be enabled.
  25. #end
  26. Function GCResume:Void()="bbGC::resume"
  27. #rem monkeydoc Allocates GC aware memory.
  28. If the requested size is large enough, it may trigger a garbage collection.
  29. #end
  30. Function GCMalloc:Void Ptr( size:UInt )="bbGC::malloc"
  31. #rem monkeydoc Frees GC aware memory.
  32. Frees memory allocated with GCMalloc.
  33. #end
  34. Function GCFree( p:Void Ptr )="bbGC::free"