Function Memory.callMemHandlers

CallMemHandlers -- Call MemHandlers to free memory.

int callMemHandlers (
  ulong byteSize,
  uint alignment,
  uint flags
);

Call MemHandlers in system list, until enough memory is available for pending Allocate#?() operation, or until no more memory can be freed by MemHandlers.

Note

Code is called with Memory Semaphore locked exclusively. So do never Wait() in your Handler !

Parameters

NameDescription
byteSize number of bytes needed for pending allocations
alignment current alignment value, or 0 for any.
flags allocation flags required for pending allocation

Returns

Return code from the handler called.

Notes

Remember to set sys_MemHandler to null, if AllocMem() is called. This will reset the current handler ptr.

See

AddMemHandler(), RemMemHandler()