43 #if PRAGMA_STRUCT_ALIGN
44 #pragma options align = mac68k
45 #elif PRAGMA_STRUCT_PACKPUSH
47 #elif PRAGMA_STRUCT_PACK
58 defaultPhysicalEntryCount = 8
81 kHandleIsResourceBit = 5,
82 kHandlePurgeableBit = 6,
89 kHandleIsResourceMask = 0x20,
90 kHandlePurgeableMask = 0x40,
91 kHandleLockedMask = 0x80
94 typedef CALLBACK_API(
long, GrowZoneProcPtr)(Size cbNeeded);
95 typedef CALLBACK_API(
void, PurgeProcPtr)(Handle blockToPurge);
138 typedef short PageState;
139 typedef short StatusRegisterContents;
142 kVolumeVirtualMemoryInfoVersion1 =
170 #if !OPAQUE_UPP_TYPES
173 uppGrowZoneProcInfo = 0x000000F0
179 (ProcPtr)(userRoutine), uppGrowZoneProcInfo, GetCurrentArchitecture());
182 #define NewGrowZoneUPP(userRoutine) \
183 (GrowZoneUPP) NewRoutineDescriptor( \
184 (ProcPtr)(userRoutine), uppGrowZoneProcInfo, GetCurrentArchitecture())
198 #if !OPAQUE_UPP_TYPES
201 uppPurgeProcInfo = 0x000000C0
204 inline PurgeUPP
NewPurgeUPP(PurgeProcPtr userRoutine)
207 (ProcPtr)(userRoutine), uppPurgeProcInfo, GetCurrentArchitecture());
210 #define NewPurgeUPP(userRoutine) \
211 (PurgeUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppPurgeProcInfo, \
212 GetCurrentArchitecture())
226 #if !OPAQUE_UPP_TYPES
229 uppUserFnProcInfo = 0x00009802
232 inline UserFnUPP
NewUserFnUPP(UserFnProcPtr userRoutine)
235 (ProcPtr)(userRoutine), uppUserFnProcInfo, GetCurrentArchitecture());
238 #define NewUserFnUPP(userRoutine) \
239 (UserFnUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppUserFnProcInfo, \
240 GetCurrentArchitecture())
254 #if !OPAQUE_UPP_TYPES
261 #define DisposeGrowZoneUPP(userUPP) DisposeRoutineDescriptor(userUPP)
275 #if !OPAQUE_UPP_TYPES
282 #define DisposePurgeUPP(userUPP) DisposeRoutineDescriptor(userUPP)
296 #if !OPAQUE_UPP_TYPES
303 #define DisposeUserFnUPP(userUPP) DisposeRoutineDescriptor(userUPP)
317 #if !OPAQUE_UPP_TYPES
321 return (
long)CALL_ONE_PARAMETER_UPP(userUPP, uppGrowZoneProcInfo, cbNeeded);
324 #define InvokeGrowZoneUPP(cbNeeded, userUPP) \
325 (long)CALL_ONE_PARAMETER_UPP((userUPP), uppGrowZoneProcInfo, (cbNeeded))
339 #if !OPAQUE_UPP_TYPES
343 CALL_ONE_PARAMETER_UPP(userUPP, uppPurgeProcInfo, blockToPurge);
346 #define InvokePurgeUPP(blockToPurge, userUPP) \
347 CALL_ONE_PARAMETER_UPP((userUPP), uppPurgeProcInfo, (blockToPurge))
359 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
360 #pragma parameter InvokeUserFnUPP(__A0, __A1)
364 #if !OPAQUE_UPP_TYPES && \
365 (!TARGET_OS_MAC || !TARGET_CPU_68K || TARGET_RT_MAC_CFM)
369 CALL_ONE_PARAMETER_UPP(userUPP, uppUserFnProcInfo, parameter);
372 #define InvokeUserFnUPP(parameter, userUPP) \
373 CALL_ONE_PARAMETER_UPP((userUPP), uppUserFnProcInfo, (parameter))
377 #if CALL_NOT_IN_CARBON || OLDROUTINENAMES
379 #define NewGrowZoneProc(userRoutine) NewGrowZoneUPP(userRoutine)
380 #define NewPurgeProc(userRoutine) NewPurgeUPP(userRoutine)
381 #define NewUserFnProc(userRoutine) NewUserFnUPP(userRoutine)
382 #define CallGrowZoneProc(userRoutine, cbNeeded) \
383 InvokeGrowZoneUPP(cbNeeded, userRoutine)
384 #define CallPurgeProc(userRoutine, blockToPurge) \
385 InvokePurgeUPP(blockToPurge, userRoutine)
386 #define CallUserFnProc(userRoutine, parameter) \
387 InvokeUserFnUPP(parameter, userRoutine)
390 #if CALL_NOT_IN_CARBON
523 ...process the error...
525 ASM programs can
check for return code values in the low word of the D0
526 register (with some exceptions).
528 * \copyright THINK Reference © 1991-1992 Symantec Corporation
529 * \non_carbon_cfm in InterfaceLib 7.1 and later
530 * \carbon_lib in CarbonLib 1.0 and later
531 * \mac_os_x in version 10.0 and later
536 #if CALL_NOT_IN_CARBON
555 TheZone->moreMast = numMastPtrs;
560 Use SetZone to make a different zone active.</ pre>
561 * \copyright THINK Reference © 1991 -
562 1992 Symantec Corporation
563 * \non_carbon_cfm in InterfaceLib 7.1 and
565 * \carbon_lib not available * \mac_os_x not available *
567 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
568 #pragma parameter __A0 GetZone
583 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
584 #pragma parameter __A0 NewHandle(__D0)
589 #if CALL_NOT_IN_CARBON
598 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
599 #pragma parameter __A0 NewHandleSys(__D0)
614 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
615 #pragma parameter __A0 NewHandleClear(__D0)
620 #if CALL_NOT_IN_CARBON
629 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
630 #pragma parameter __A0 NewHandleSysClear(__D0)
658 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
659 #pragma parameter __A0 HandleZone(__A0)
674 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
675 #pragma parameter __A0 RecoverHandle(__A0)
680 #if CALL_NOT_IN_CARBON
689 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
690 #pragma parameter __A0 RecoverHandleSys(__A0)
705 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
706 #pragma parameter __A0 NewPtr(__D0)
711 #if CALL_NOT_IN_CARBON
720 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
721 #pragma parameter __A0 NewPtrSys(__D0)
736 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
737 #pragma parameter __A0 NewPtrClear(__D0)
742 #if CALL_NOT_IN_CARBON
751 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
752 #pragma parameter __A0 NewPtrSysClear(__D0)
777 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
778 #pragma parameter __A0 PtrZone(__A0)
812 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
813 #pragma parameter __D0 MaxBlock
818 #if CALL_NOT_IN_CARBON
827 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
828 #pragma parameter __D0 MaxBlockSys
863 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
864 #pragma parameter __D0 StackSpace
877 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
878 #pragma parameter __A0 NewEmptyHandle
883 #if CALL_NOT_IN_CARBON
892 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
893 #pragma parameter __A0 NewEmptyHandleSys
930 In the example above, the FrameRect
function could cause a heap
931 compaction, so the value of msp (a pointer to the
myHandle data area) could
932 become invalid. By surrounding the sequence with HLock and
HUnlock ,
933 you ensure that all pointers to a handle
's data area remain valid.
934 If you are certain that no heap manipulation will take place, or if you make
935 an effort to adjust for it, you need not lock the handle. For instance, in the
936 following sequence, the values of x and y are assigned via double
937 indirection, so even if FrameRect causes the data to move, it will be found
938 by both assignment statements.
939 myHandle = NewHandle ( sizeof(myStruct) );
940 x = (*myHandle)->myX; /* double indirection is valid even */
943 * \copyright THINK Reference © 1991 - 1992 Symantec Corporation
944 * \non_carbon_cfm in InterfaceLib 7.1 and
946 * \carbon_lib in CarbonLib 1.0 and
948 * \mac_os_x in version 10.0 and
951 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
952 #pragma parameter HLock(__A0)
984 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
985 #pragma parameter HUnlock(__A0)
1011 HPurge(myHandle); /* allow purge */
1013 : if (*myHandle == 0)
1014 { /* data has been purged */
1015 ReallocHandle(myHandle, 1000); /* get some storage */
1017 ./* regenerate lost data; load resource, etc. */
1020 HNoPurge(myHandle); /* don't allow purge
now */
1023 Use HNoPurge to undo the effect of
this function (first be sure that the
1024 handle hasn
't been purged!).
1026 * \copyright THINK Reference © 1991-1992 Symantec Corporation
1027 * \non_carbon_cfm in InterfaceLib 7.1 and later
1028 * \carbon_lib in CarbonLib 1.0 and later
1029 * \mac_os_x in version 10.0 and later
1031 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1032 #pragma parameter HPurge(__A0)
1057 if ( *myHandle == 0 ) { /* it got purged */
1058 ReallocHandle(myHandle, MYH_SIZE);
1059 ... regenerate the handle's data ...
1063 * \copyright THINK Reference © 1991-1992 Symantec Corporation
1064 * \non_carbon_cfm in InterfaceLib 7.1 and later
1065 * \carbon_lib in CarbonLib 1.0 and later
1066 * \mac_os_x in version 10.0 and later
1068 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1069 #pragma parameter HNoPurge(__A0)
1082 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1083 #pragma parameter HLockHi(__A0)
1142 #if CALL_NOT_IN_CARBON
1152 InitZone(GrowZoneUPP pgrowZone,
short cmoreMasters,
void *limitPtr,
1157 #if CALL_NOT_IN_CARBON
1184 SetZone ( ApplicZone () );
1185 (*myHandle)->myField = myValue;
1187 * \copyright THINK Reference © 1991-1992 Symantec Corporation
1188 * \non_carbon_cfm in InterfaceLib 7.1 and later
1189 * \carbon_lib not available
1190 * \mac_os_x not available
1192 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1193 #pragma parameter SetZone(__A0)
1208 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1209 #pragma parameter __D0 CompactMem(__D0)
1214 #if CALL_NOT_IN_CARBON
1223 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1224 #pragma parameter __D0 CompactMemSys(__D0)
1239 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1240 #pragma parameter PurgeMem(__D0)
1245 #if CALL_NOT_IN_CARBON
1254 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1255 #pragma parameter PurgeMemSys(__D0)
1270 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1271 #pragma parameter __D0 FreeMem
1276 #if CALL_NOT_IN_CARBON
1285 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1286 #pragma parameter __D0 FreeMemSys
1301 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1302 #pragma parameter ReserveMem(__D0)
1307 #if CALL_NOT_IN_CARBON
1316 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1317 #pragma parameter ReserveMemSys(__D0)
1332 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1333 #pragma parameter __D0 MaxMem(__A1)
1338 #if CALL_NOT_IN_CARBON
1347 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1348 #pragma parameter __D0 MaxMemSys(__A1)
1379 .Attempt to free or unlock memory . . .
1380 .. . . but
don't alter saveHandle
1382 return( 0 ); /* zero if unable to free or unlock any memory */
1383 return( 1 ); /* non-zero if able to make some progress */
1385 /* Early in the program, install this procedure as follows */
1386 SetZone(whateverZone); /* make desired zone current */
1387 SetGrowZone(MyGrowFn);
1388 On entry, bytesNeeded is the required amount of memory, including the block header(i.e., the actual amount needed).The custom function should attempt to find places where the application can economize; e.g., it can call
1389 EmptyHandle to purge transient data or it can write important data to a
1390 disk file (for later recovery) and mark the block as purgeable (see
1391 HPurge ). It can also unlock ( HUnlock ) blocks, in the hope that this will
1392 unfragment the heap, thus freeing a larger block.
1393 Note: a single handle, the "grow zone root" handle should not be disturbed
1394 by your function. See GZSaveHnd .
1395 On exit, the grow-zone function should return 0 if it was unable to free or
1397 * \copyright THINK Reference © 1991-1992 Symantec Corporation
1398 * \non_carbon_cfm in InterfaceLib 7.1 and later
1399 * \carbon_lib in CarbonLib 1.0 and later
1400 * \mac_os_x in version 10.0 and later
1402 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1403 #pragma parameter SetGrowZone(__A0)
1406 SetGrowZone(GrowZoneUPP growZone);
1427 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1428 #pragma parameter MoveHHi(__A0)
1441 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1442 #pragma parameter DisposePtr(__A0)
1474 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1475 #pragma parameter SetPtrSize(__A0, __D0)
1478 SetPtrSize(Ptr p, Size newSize);
1488 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1489 #pragma parameter DisposeHandle(__A0)
1492 DisposeHandle(Handle h);
1502 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1503 #pragma parameter SetHandleSize(__A0, __D0)
1506 SetHandleSize(Handle h, Size newSize);
1542 GetHandleSize(Handle h);
1544 #if CALL_NOT_IN_CARBON
1553 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1554 #pragma parameter __D0 InlineGetHandleSize(__A0)
1557 InlineGetHandleSize(Handle h);
1559 #endif /* CALL_NOT_IN_CARBON */
1569 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1570 #pragma parameter ReallocateHandle(__A0, __D0)
1573 ReallocateHandle(Handle h, Size byteCount);
1575 #if CALL_NOT_IN_CARBON
1584 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1585 #pragma parameter ReallocateHandleSys(__A0, __D0)
1588 ReallocateHandleSys(Handle h, Size byteCount);
1590 #endif /* CALL_NOT_IN_CARBON */
1600 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1601 #pragma parameter EmptyHandle(__A0)
1604 EmptyHandle(Handle h);
1631 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1632 #pragma parameter HSetRBit(__A0)
1660 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1661 #pragma parameter HClrRBit(__A0)
1690 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1691 #pragma parameter __D0 HGetState(__A0)
1694 HGetState(Handle h);
1704 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1705 #pragma parameter HSetState(__A0, __D0)
1708 HSetState(Handle h, SInt8 flags);
1719 PurgeSpace(long *total, long *contig);
1735 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1736 #pragma parameter __A0 PurgeSpaceTotal
1739 PurgeSpaceTotal(void);
1749 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1750 #pragma parameter __D0 PurgeSpaceContiguous
1753 PurgeSpaceContiguous(void);
1755 #if CALL_NOT_IN_CARBON
1764 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1765 #pragma parameter __A0 PurgeSpaceSysTotal
1768 PurgeSpaceSysTotal(void);
1778 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1779 #pragma parameter __D0 PurgeSpaceSysContiguous
1782 PurgeSpaceSysContiguous(void);
1797 #endif /* CALL_NOT_IN_CARBON */
1836 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1837 #pragma parameter BlockMove(__A0, __A1, __D0)
1840 BlockMove(const void *srcPtr, void *destPtr, Size byteCount);
1850 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1851 #pragma parameter BlockMoveData(__A0, __A1, __D0)
1854 BlockMoveData(const void *srcPtr, void *destPtr, Size byteCount);
1865 BlockMoveUncached(const void *srcPtr, void *destPtr, Size byteCount);
1876 BlockMoveDataUncached(const void *srcPtr, void *destPtr, Size byteCount);
1887 BlockZero(void *destPtr, Size byteCount);
1898 BlockZeroUncached(void *destPtr, Size byteCount);
1900 #if CALL_NOT_IN_CARBON
1931 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1932 #pragma parameter SetApplBase(__A0)
1935 SetApplBase(void *startPtr);
1937 #endif /* CALL_NOT_IN_CARBON */
1959 MoreMasterPointers(UInt32 inCount);
1961 #if CALL_NOT_IN_CARBON
1991 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1992 #pragma parameter SetApplLimit(__A0)
1995 SetApplLimit(void *zoneLimit);
2008 /* Temporary Memory routines renamed, but obsolete, in System 7.0 and later. */
2009 #endif /* CALL_NOT_IN_CARBON */
2030 TempHLock(Handle h, OSErr *resultCode);
2052 TempHUnlock(Handle h, OSErr *resultCode);
2072 TempDisposeHandle(Handle h, OSErr *resultCode);
2116 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
2117 #pragma parameter __D0 HoldMemory(__A0, __A1)
2120 HoldMemory(void *address, unsigned long count);
2148 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
2149 #pragma parameter __D0 UnholdMemory(__A0, __A1)
2152 UnholdMemory(void *address, unsigned long count);
2154 #if CALL_NOT_IN_CARBON
2180 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
2181 #pragma parameter __D0 LockMemory(__A0, __A1)
2184 LockMemory(void *address, unsigned long count);
2194 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
2195 #pragma parameter __D0 LockMemoryForOutput(__A0, __A1)
2198 LockMemoryForOutput(void *address, unsigned long count);
2227 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
2228 #pragma parameter __D0 LockMemoryContiguous(__A0, __A1)
2231 LockMemoryContiguous(void *address, unsigned long count);
2257 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
2258 #pragma parameter __D0 UnlockMemory(__A0, __A1)
2261 UnlockMemory(void *address, unsigned long count);
2263 #endif /* CALL_NOT_IN_CARBON */
2273 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
2274 #pragma parameter __D0 MakeMemoryResident(__A0, __A1)
2277 MakeMemoryResident(void *address, unsigned long count);
2287 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
2288 #pragma parameter __D0 ReleaseMemoryData(__A0, __A1)
2291 ReleaseMemoryData(void *address, unsigned long count);
2301 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
2302 #pragma parameter __D0 MakeMemoryNonResident(__A0, __A1)
2305 MakeMemoryNonResident(void *address, unsigned long count);
2315 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
2316 #pragma parameter __D0 FlushMemory(__A0, __A1)
2319 FlushMemory(void *address, unsigned long count);
2321 #if CALL_NOT_IN_CARBON
2350 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
2351 #pragma parameter __D0 GetPhysical(__A0, __A1)
2354 GetPhysical(LogicalToPhysicalTable *addresses,
2355 unsigned long *physicalEntryCount);
2357 #endif /* CALL_NOT_IN_CARBON */
2359 #if CALL_NOT_IN_CARBON
2368 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
2369 #pragma parameter __D0 GetVolumeVirtualMemoryInfo(__A0)
2372 GetVolumeVirtualMemoryInfo(VolumeVirtualMemoryInfoPtr volVMInfo);
2401 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
2402 #pragma parameter __D0 DeferUserFn(__A0, __D0)
2405 DeferUserFn(UserFnUPP userFunction, void *argument);
2423 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
2424 #pragma parameter __D0 DebuggerGetMax
2427 DebuggerGetMax(void);
2443 DebuggerEnter(void);
2492 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
2493 #pragma parameter __D0 GetPageState(__A0)
2496 GetPageState(const void *address);
2515 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
2516 #pragma parameter __D0 PageFaultFatal
2519 PageFaultFatal(void);
2545 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
2546 #pragma parameter __D0 DebuggerLockMemory(__A0, __A1)
2549 DebuggerLockMemory(void *address, unsigned long count);
2574 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
2575 #pragma parameter __D0 DebuggerUnlockMemory(__A0, __A1)
2578 DebuggerUnlockMemory(void *address, unsigned long count);
2590 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
2591 #pragma parameter __D0 EnterSupervisorMode
2593 StatusRegisterContents
2594 EnterSupervisorMode(void);
2612 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
2613 #pragma parameter __D0 StripAddress(__D0)
2616 StripAddress(void *theAddress);
2617 #if !TARGET_OS_MAC || !TARGET_CPU_68K
2619 inline DEFINE_API(Ptr) StripAddress(void *theAddress)
2621 return (Ptr)theAddress;
2624 #define StripAddress(theAddress) ((Ptr)theAddress)
2645 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
2646 #pragma parameter __D0 Translate24To32(__D0)
2649 Translate24To32(void *addr24);
2650 #if !TARGET_OS_MAC || !TARGET_CPU_68K
2652 inline DEFINE_API(Ptr) Translate24To32(void *addr24) { return (Ptr)addr24; }
2654 #define Translate24To32(addr24) ((Ptr)addr24)
2658 #endif /* CALL_NOT_IN_CARBON */
2691 HandToHand(Handle *theHndl);
2701 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
2702 #pragma parameter __D0 PtrToXHand(__A0, __A1, __D0)
2705 PtrToXHand(const void *srcPtr, Handle dstHndl, long size);
2716 PtrToHand(const void *srcPtr, Handle *dstHndl, long size);
2726 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
2727 #pragma parameter __D0 HandAndHand(__A0, __A1)
2730 HandAndHand(Handle hand1, Handle hand2);
2740 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
2741 #pragma parameter __D0 PtrAndHand(__A0, __A1, __D0)
2744 PtrAndHand(const void *ptr1, Handle hand2, long size);
2746 /* Carbon routines to aid in debugging. */
2747 /* Checks all applicable heaps for validity */
2757 CheckAllHeaps(void);
2759 /* Checks the application heap for validity */
2771 /* It is invalid to pass a NULL or an empty Handle to IsHandleValid */
2781 IsHandleValid(Handle h);
2783 /* It is invalid to pass a NULL Pointer to IsPointerValid */
2793 IsPointerValid(Ptr p);
2796 #define ApplicZone() ApplicationZone()
2797 #define MFTempNewHandle(logicalSize, resultCode) \
2798 TempNewHandle(logicalSize, resultCode)
2799 #define MFMaxMem(grow) TempMaxMem(grow)
2800 #define MFFreeMem() TempFreeMem()
2801 #define MFTempHLock(h, resultCode) TempHLock(h, resultCode)
2802 #define MFTempHUnlock(h, resultCode) TempHUnlock(h, resultCode)
2803 #define MFTempDisposHandle(h, resultCode) TempDisposeHandle(h, resultCode)
2804 #define MFTopMem() TempTopMem()
2805 #define ResrvMem(cbNeeded) ReserveMem(cbNeeded)
2806 #define DisposPtr(p) DisposePtr(p)
2807 #define DisposHandle(h) DisposeHandle(h)
2808 #define ReallocHandle(h, byteCount) ReallocateHandle(h, byteCount)
2809 #endif /* OLDROUTINENAMES */
2811 #if PRAGMA_STRUCT_ALIGN
2812 #pragma options align = reset
2813 #elif PRAGMA_STRUCT_PACKPUSH
2815 #elif PRAGMA_STRUCT_PACK
2819 #ifdef PRAGMA_IMPORT_OFF
2822 #pragma import reset
2829 #endif /* __MACMEMORY__ */
2831 * \mac_os_x in version 10.0 and
2835 IsPointerValid(Ptr p);
2838 #define ApplicZone() ApplicationZone()
2839 #define MFTempNewHandle(logicalSize, resultCode) \
2840 TempNewHandle(logicalSize, resultCode)
2841 #define MFMaxMem(grow) TempMaxMem(grow)
2842 #define MFFreeMem() TempFreeMem()
2843 #define MFTempHLock(h, resultCode) TempHLock(h, resultCode)
2844 #define MFTempHUnlock(h, resultCode) TempHUnlock(h, resultCode)
2845 #define MFTempDisposHandle(h, resultCode) TempDisposeHandle(h, resultCode)
2846 #define MFTopMem() TempTopMem()
2847 #define ResrvMem(cbNeeded) ReserveMem(cbNeeded)
2848 #define DisposPtr(p) DisposePtr(p)
2849 #define DisposHandle(h) DisposeHandle(h)
2850 #define ReallocHandle(h, byteCount) ReallocateHandle(h, byteCount)
2851 #endif /* OLDROUTINENAMES */
2853 #if PRAGMA_STRUCT_ALIGN
2854 #pragma options align = reset
2855 #elif PRAGMA_STRUCT_PACKPUSH
2857 #elif PRAGMA_STRUCT_PACK
2861 #ifdef PRAGMA_IMPORT_OFF
2864 #pragma import reset
2871 #endif /* __MACMEMORY__ */
2872 * /*/*/ * /*/*/ * /*/*/ * /*/*/ * /*/*/ * /*/*/ * /*/*/ * /*/*/ * /*/*/ * /*/*/ * /*/*/ * /*/*/ * /*/*/ * /*/*/ * /*/*/ * /*/*/ * /
GetTime & now
Get current date and time in DateTimeRec format.
Definition: DateTimeUtils.h:539
#define check(assertion)
Definition: Debugging.h:819
* don
Definition: Fonts.h:1156
Ptr NewPtrSys(Size byteCount)
void PurgeMem(Size cbNeeded)
Ptr NewPtrSysClear(Size byteCount)
Size TempMaxMem(Size *grow)
void InvokePurgeUPP(Handle blockToPurge, PurgeUPP userUPP)
long StackSpace(void)
Obtain amount of unused space in the stack.
Handle NewEmptyHandle(void)
THz PtrZone(Ptr p)
Find which heap zone owns a nonrelocatable block.
Handle RecoverHandleSys(Ptr p)
void InvokeUserFnUPP(void *parameter, UserFnUPP userUPP)
In the example the FrameRect function could cause a heap so the value of you ensure that all pointers to a handle s data area remain valid If you are certain that no heap manipulation will take or if you make an effort to adjust for you need not lock the handle For in the following the values of x and y are assigned via double so even if FrameRect causes the data to it will be found by both assignment statements myHandle
Definition: MacMemory.h:939
void InitZone(GrowZoneUPP pgrowZone, short cmoreMasters, void *limitPtr, void *startPtr)
UserFnUPP NewUserFnUPP(UserFnProcPtr userRoutine)
Handle NewEmptyHandleSys(void)
Handle NewHandle(Size byteCount)
void DisposePurgeUPP(PurgeUPP userUPP)
Handle NewHandleClear(Size byteCount)
void PurgeMemSys(Size cbNeeded)
Handle TempNewHandle(Size logicalSize, OSErr *resultCode)
Handle RecoverHandle(Ptr p)
Size CompactMemSys(Size cbNeeded)
void DisposeUserFnUPP(UserFnUPP userUPP)
Size MaxMemSys(Size *grow)
GrowZoneUPP NewGrowZoneUPP(GrowZoneProcPtr userRoutine)
Ptr NewPtrClear(Size byteCount)
void ReserveMem(Size cbNeeded)
long InvokeGrowZoneUPP(Size cbNeeded, GrowZoneUPP userUPP)
THz ApplicationZone(void)
Size CompactMem(Size cbNeeded)
Handle NewHandleSys(Size byteCount)
void DisposeGrowZoneUPP(GrowZoneUPP userUPP)
Ptr NewPtr(Size byteCount)
void HUnlock(Handle h)
Unlock a handle's data (allowing it to be moved)
void ReserveMemSys(Size cbNeeded)
Handle NewHandleSysClear(Size byteCount)
PurgeUPP NewPurgeUPP(PurgeProcPtr userRoutine)
THz HandleZone(Handle h)
Find which heap zone owns relocatable block.
long MaxBlock(void)
Get size of largest block (without compacting)
ASM programs can check for return code values in the low word of the D0 register(with some exceptions).</pre > *@par Copyright oldMoreMast
Get address of the current heap zone.
Definition: MacMemory.h:554
Basic Macintosh data types.
unsigned char Boolean
Definition: MacTypes.h:318
Mixed Mode Manager Interfaces.
void DisposeRoutineDescriptor(UniversalProcPtr theUPP)
#define STACK_UPP_TYPE(name)
Definition: MixedMode.h:734
UniversalProcPtr NewRoutineDescriptor(ProcPtr theProc, ProcInfoType theProcInfo, ISAType theISA)
typedef CALLBACK_API_REGISTER68K(void, SIInterruptProcPtr,(SPBPtr inParamPtr, Ptr dataBuffer, short peakAmplitude, long sampleSize))
typedef REGISTER_UPP_TYPE(HighHookProcPtr) HighHookUPP
Definition: MacMemory.h:132
Definition: MacMemory.h:126
Definition: MacMemory.h:147
Definition: MacMemory.h:101