mirror of
https://github.com/vivier/EMILE.git
synced 2024-12-23 01:29:34 +00:00
31 lines
544 B
C
31 lines
544 B
C
/*
|
|
*
|
|
* (c) 2004,2005 Laurent Vivier <Laurent@lvivier.info>
|
|
*
|
|
*/
|
|
|
|
#ifndef __MACOS_MEMORY_H__
|
|
#define __MACOS_MEMORY_H__
|
|
|
|
#include <macos/traps.h>
|
|
|
|
static inline void DisposePtr(void* ptr)
|
|
{
|
|
asm("move.l %0, %%a0\n"
|
|
Trap(_DisposePtr)
|
|
:: "g" (ptr) : "%%d0", UNPRESERVED_REGS);
|
|
}
|
|
|
|
static inline void* NewPtr(unsigned long byteCount)
|
|
{
|
|
register void* ptr;
|
|
|
|
asm("move.l %1, %%d0\n"
|
|
Trap(_NewPtr)
|
|
" move.l %%a0, %0\n"
|
|
: "=g" (ptr) : "g" (byteCount) : "%%d0", UNPRESERVED_REGS);
|
|
|
|
return ptr;
|
|
}
|
|
#endif /* __MACOS_MEMORY_H__ */
|