mpw/toolbox/mm.h

52 lines
920 B
C
Raw Normal View History

2013-02-08 03:49:20 +00:00
#ifndef __mpw_mm_h__
#define __mpw_mm_h__
2013-02-08 03:12:30 +00:00
#include <cstdint>
namespace MM
{
enum
{
2013-02-11 01:19:11 +00:00
memFullErr = -108,
memWZErr = -111,
2013-02-08 03:49:20 +00:00
};
// native functions.
namespace Native
{
2013-02-18 02:54:45 +00:00
void PrintMemoryStats();
uint16_t NewHandle(uint32_t size, uint32_t &handle);
2013-02-17 20:07:32 +00:00
uint16_t NewPtr(uint32_t size, bool clear, uint32_t &pointer);
uint16_t DisposeHandle(uint32_t handle);
uint16_t DisposePtr(uint32_t pointer);
}
2013-02-18 02:54:45 +00:00
bool Init(uint8_t *memory, uint32_t memorySize, uint32_t reserved);
2013-02-08 04:44:58 +00:00
uint16_t BlockMove(uint16_t trap);
2013-02-15 05:08:22 +00:00
uint32_t CompactMem(uint16_t trap);
2013-02-16 20:37:55 +00:00
2013-02-15 04:08:56 +00:00
uint16_t DisposeHandle(uint16_t trap);
2013-02-16 20:37:55 +00:00
uint16_t DisposePtr(uint16_t trap);
uint32_t GetHandleSize(uint16_t);
uint32_t GetPtrSize(uint16_t);
2013-02-15 04:08:56 +00:00
uint16_t NewHandle(uint16_t trap);
2013-02-16 20:37:55 +00:00
uint16_t NewPtr(uint16_t trap);
2013-02-16 01:33:00 +00:00
uint16_t SetHandleSize(uint16_t);
2013-02-16 20:37:55 +00:00
uint16_t SetPtrSize(uint16_t);
uint16_t HLock(uint16_t trap);
uint16_t HUnlock(uint16_t trap);
2013-02-08 03:12:30 +00:00
}
2013-02-15 05:08:22 +00:00
2013-02-08 03:12:30 +00:00
#endif