mirror of
https://github.com/autc04/Retro68.git
synced 2024-12-29 05:29:47 +00:00
16 lines
279 B
C
16 lines
279 B
C
#include <MacMemory.h>
|
|
|
|
Size GetPtrSize(Ptr ptr)
|
|
{
|
|
long tmp;
|
|
__asm__ __volatile__(
|
|
"move.l %1, %%a0\n\t"
|
|
"dc.w 0xA021\n\t"
|
|
"move.l %%d0, %1"
|
|
: "=g"(tmp) : "g"(ptr) : "%%a0", "%%d0");
|
|
if(tmp > 0)
|
|
return (Size) tmp;
|
|
else
|
|
return 0;
|
|
}
|