MacMemory.h
上传用户:xjjlds
上传日期:2015-12-05
资源大小:22823k
文件大小:60k
源码类别:

多媒体编程

开发平台:

Visual C++

  1. /*
  2.      File:       MacMemory.h
  3.  
  4.      Contains:   Memory Manager Interfaces.
  5.  
  6.      Version:    Technology: System 8.5
  7.                  Release:    QuickTime 6.0.2
  8.  
  9.      Copyright:  (c) 1985-2001 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:      For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __MACMEMORY__
  18. #define __MACMEMORY__
  19. #ifndef __MACTYPES__
  20. #include "MacTypes.h"
  21. #endif
  22. #ifndef __MIXEDMODE__
  23. #include "MixedMode.h"
  24. #endif
  25. #if PRAGMA_ONCE
  26. #pragma once
  27. #endif
  28. #ifdef __cplusplus
  29. extern "C" {
  30. #endif
  31. #if PRAGMA_IMPORT
  32. #pragma import on
  33. #endif
  34. #if PRAGMA_STRUCT_ALIGN
  35.     #pragma options align=mac68k
  36. #elif PRAGMA_STRUCT_PACKPUSH
  37.     #pragma pack(push, 2)
  38. #elif PRAGMA_STRUCT_PACK
  39.     #pragma pack(2)
  40. #endif
  41. enum {
  42.     maxSize                     = 0x7FFFFFF0                    /*the largest block possible*/
  43. };
  44. enum {
  45.     defaultPhysicalEntryCount   = 8
  46. };
  47. enum {
  48.                                                                 /* values returned from the GetPageState function */
  49.     kPageInMemory               = 0,
  50.     kPageOnDisk                 = 1,
  51.     kNotPaged                   = 2
  52. };
  53. enum {
  54.                                                                 /* masks for Zone->heapType field */
  55.     k32BitHeap                  = 1,                            /* valid in all Memory Managers */
  56.     kNewStyleHeap               = 2,                            /* true if new Heap Manager is present */
  57.     kNewDebugHeap               = 4                             /* true if new Heap Manager is running in debug mode on this heap */
  58. };
  59. /* Note: The type "Size" moved to Types.h */
  60. typedef CALLBACK_API( long , GrowZoneProcPtr )(Size cbNeeded);
  61. typedef CALLBACK_API( void , PurgeProcPtr )(Handle blockToPurge);
  62. typedef CALLBACK_API( void , UserFnProcPtr )(void *parameter);
  63. /*
  64.     WARNING: UserFnProcPtr uses register based parameters under classic 68k
  65.              and cannot be written in a high-level language without 
  66.              the help of mixed mode or assembly glue.
  67. */
  68. typedef STACK_UPP_TYPE(GrowZoneProcPtr)                         GrowZoneUPP;
  69. typedef STACK_UPP_TYPE(PurgeProcPtr)                            PurgeUPP;
  70. typedef REGISTER_UPP_TYPE(UserFnProcPtr)                        UserFnUPP;
  71. struct Zone {
  72.     Ptr                             bkLim;
  73.     Ptr                             purgePtr;
  74.     Ptr                             hFstFree;
  75.     long                            zcbFree;
  76.     GrowZoneUPP                     gzProc;
  77.     short                           moreMast;
  78.     short                           flags;
  79.     short                           cntRel;
  80.     short                           maxRel;
  81.     short                           cntNRel;
  82.     SInt8                           heapType;                   /* previously "maxNRel", now holds flags (e.g. k32BitHeap)*/
  83.     SInt8                           unused;
  84.     short                           cntEmpty;
  85.     short                           cntHandles;
  86.     long                            minCBFree;
  87.     PurgeUPP                        purgeProc;
  88.     Ptr                             sparePtr;
  89.     Ptr                             allocPtr;
  90.     short                           heapData;
  91. };
  92. typedef struct Zone                     Zone;
  93. typedef Zone *                          THz;
  94. struct MemoryBlock {
  95.     void *                          address;
  96.     unsigned long                   count;
  97. };
  98. typedef struct MemoryBlock              MemoryBlock;
  99. struct LogicalToPhysicalTable {
  100.     MemoryBlock                     logical;
  101.     MemoryBlock                     physical[8];
  102. };
  103. typedef struct LogicalToPhysicalTable   LogicalToPhysicalTable;
  104. typedef short                           PageState;
  105. typedef short                           StatusRegisterContents;
  106. enum {
  107.     kVolumeVirtualMemoryInfoVersion1 = 1                        /* first version of VolumeVirtualMemoryInfo*/
  108. };
  109. struct VolumeVirtualMemoryInfo {
  110.     PBVersion                       version;                    /* Input: Version of the VolumeVirtualMemoryInfo structure*/
  111.     SInt16                          volumeRefNum;               /* Input: volume reference number*/
  112.     Boolean                         inUse;                      /* output: true if volume is currently used for file mapping*/
  113.     UInt8                           _fill;
  114.     UInt32                          vmOptions;                  /* output: tells what volume can support (same as DriverGestaltVMOptionsResponse vmOptions bits in DriverGestalt)*/
  115.                                                                 /* end of kVolumeVirtualMemoryInfoVersion1 structure*/
  116. };
  117. typedef struct VolumeVirtualMemoryInfo  VolumeVirtualMemoryInfo;
  118. typedef VolumeVirtualMemoryInfo *       VolumeVirtualMemoryInfoPtr;
  119. #if OPAQUE_UPP_TYPES
  120.     EXTERN_API(GrowZoneUPP)
  121.     NewGrowZoneUPP                 (GrowZoneProcPtr         userRoutine);
  122.     EXTERN_API(PurgeUPP)
  123.     NewPurgeUPP                    (PurgeProcPtr            userRoutine);
  124.     EXTERN_API(UserFnUPP)
  125.     NewUserFnUPP                   (UserFnProcPtr           userRoutine);
  126.     EXTERN_API(void)
  127.     DisposeGrowZoneUPP             (GrowZoneUPP             userUPP);
  128.     EXTERN_API(void)
  129.     DisposePurgeUPP                (PurgeUPP                userUPP);
  130.     EXTERN_API(void)
  131.     DisposeUserFnUPP               (UserFnUPP               userUPP);
  132.     EXTERN_API(long)
  133.     InvokeGrowZoneUPP              (Size                    cbNeeded,
  134.                                     GrowZoneUPP             userUPP);
  135.     EXTERN_API(void)
  136.     InvokePurgeUPP                 (Handle                  blockToPurge,
  137.                                     PurgeUPP                userUPP);
  138.     EXTERN_API(void)
  139.     InvokeUserFnUPP                (void *                  parameter,
  140.                                     UserFnUPP               userUPP);
  141. #else
  142.     enum { uppGrowZoneProcInfo = 0x000000F0 };                      /* pascal 4_bytes Func(4_bytes) */
  143.     enum { uppPurgeProcInfo = 0x000000C0 };                         /* pascal no_return_value Func(4_bytes) */
  144.     enum { uppUserFnProcInfo = 0x00009802 };                        /* register no_return_value Func(4_bytes:A0) */
  145.     #define NewGrowZoneUPP(userRoutine)                             (GrowZoneUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppGrowZoneProcInfo, GetCurrentArchitecture())
  146.     #define NewPurgeUPP(userRoutine)                                (PurgeUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppPurgeProcInfo, GetCurrentArchitecture())
  147.     #define NewUserFnUPP(userRoutine)                               (UserFnUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppUserFnProcInfo, GetCurrentArchitecture())
  148.     #define DisposeGrowZoneUPP(userUPP)                             DisposeRoutineDescriptor(userUPP)
  149.     #define DisposePurgeUPP(userUPP)                                DisposeRoutineDescriptor(userUPP)
  150.     #define DisposeUserFnUPP(userUPP)                               DisposeRoutineDescriptor(userUPP)
  151.     #define InvokeGrowZoneUPP(cbNeeded, userUPP)                    (long)CALL_ONE_PARAMETER_UPP((userUPP), uppGrowZoneProcInfo, (cbNeeded))
  152.     #define InvokePurgeUPP(blockToPurge, userUPP)                   CALL_ONE_PARAMETER_UPP((userUPP), uppPurgeProcInfo, (blockToPurge))
  153.     #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  154.     #pragma parameter InvokeUserFnUPP(__A0, __A1)
  155.     void InvokeUserFnUPP(void * parameter, UserFnUPP userUPP) = 0x4E91;
  156.     #else
  157.         #define InvokeUserFnUPP(parameter, userUPP)                     CALL_ONE_PARAMETER_UPP((userUPP), uppUserFnProcInfo, (parameter))
  158.     #endif
  159. #endif
  160. /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
  161. #define NewGrowZoneProc(userRoutine)                            NewGrowZoneUPP(userRoutine)
  162. #define NewPurgeProc(userRoutine)                               NewPurgeUPP(userRoutine)
  163. #define NewUserFnProc(userRoutine)                              NewUserFnUPP(userRoutine)
  164. #define CallGrowZoneProc(userRoutine, cbNeeded)                 InvokeGrowZoneUPP(cbNeeded, userRoutine)
  165. #define CallPurgeProc(userRoutine, blockToPurge)                InvokePurgeUPP(blockToPurge, userRoutine)
  166. #define CallUserFnProc(userRoutine, parameter)                  InvokeUserFnUPP(parameter, userRoutine)
  167. #if CALL_NOT_IN_CARBON
  168. EXTERN_API( Ptr )
  169. GetApplLimit                    (void)                                                      TWOWORDINLINE(0x2EB8, 0x0130);
  170. EXTERN_API( THz )
  171. SystemZone                      (void)                                                      TWOWORDINLINE(0x2EB8, 0x02A6);
  172. EXTERN_API( THz )
  173. ApplicationZone                 (void)                                                      TWOWORDINLINE(0x2EB8, 0x02AA);
  174. #endif  /* CALL_NOT_IN_CARBON */
  175. EXTERN_API( Handle )
  176. GZSaveHnd                       (void)                                                      TWOWORDINLINE(0x2EB8, 0x0328);
  177. EXTERN_API( Ptr )
  178. TopMem                          (void)                                                      TWOWORDINLINE(0x2EB8, 0x0108);
  179. EXTERN_API( OSErr )
  180. MemError                        (void)                                                      TWOWORDINLINE(0x3EB8, 0x0220);
  181. #if CALL_NOT_IN_CARBON
  182.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  183.                                                                                             #pragma parameter __A0 GetZone
  184.                                                                                             #endif
  185. EXTERN_API( THz )
  186. GetZone                         (void)                                                      ONEWORDINLINE(0xA11A);
  187. #endif  /* CALL_NOT_IN_CARBON */
  188.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  189.                                                                                             #pragma parameter __A0 NewHandle(__D0)
  190.                                                                                             #endif
  191. EXTERN_API( Handle )
  192. NewHandle                       (Size                   byteCount)                          ONEWORDINLINE(0xA122);
  193. #if CALL_NOT_IN_CARBON
  194.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  195.                                                                                             #pragma parameter __A0 NewHandleSys(__D0)
  196.                                                                                             #endif
  197. EXTERN_API( Handle )
  198. NewHandleSys                    (Size                   byteCount)                          ONEWORDINLINE(0xA522);
  199. #endif  /* CALL_NOT_IN_CARBON */
  200.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  201.                                                                                             #pragma parameter __A0 NewHandleClear(__D0)
  202.                                                                                             #endif
  203. EXTERN_API( Handle )
  204. NewHandleClear                  (Size                   byteCount)                          ONEWORDINLINE(0xA322);
  205. #if CALL_NOT_IN_CARBON
  206.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  207.                                                                                             #pragma parameter __A0 NewHandleSysClear(__D0)
  208.                                                                                             #endif
  209. EXTERN_API( Handle )
  210. NewHandleSysClear               (Size                   byteCount)                          ONEWORDINLINE(0xA722);
  211.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  212.                                                                                             #pragma parameter __A0 HandleZone(__A0)
  213.                                                                                             #endif
  214. EXTERN_API( THz )
  215. HandleZone                      (Handle                 h)                                  ONEWORDINLINE(0xA126);
  216. #endif  /* CALL_NOT_IN_CARBON */
  217.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  218.                                                                                             #pragma parameter __A0 RecoverHandle(__A0)
  219.                                                                                             #endif
  220. EXTERN_API( Handle )
  221. RecoverHandle                   (Ptr                    p)                                  ONEWORDINLINE(0xA128);
  222. #if CALL_NOT_IN_CARBON
  223.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  224.                                                                                             #pragma parameter __A0 RecoverHandleSys(__A0)
  225.                                                                                             #endif
  226. EXTERN_API( Handle )
  227. RecoverHandleSys                (Ptr                    p)                                  ONEWORDINLINE(0xA528);
  228. #endif  /* CALL_NOT_IN_CARBON */
  229.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  230.                                                                                             #pragma parameter __A0 NewPtr(__D0)
  231.                                                                                             #endif
  232. EXTERN_API( Ptr )
  233. NewPtr                          (Size                   byteCount)                          ONEWORDINLINE(0xA11E);
  234. #if CALL_NOT_IN_CARBON
  235.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  236.                                                                                             #pragma parameter __A0 NewPtrSys(__D0)
  237.                                                                                             #endif
  238. EXTERN_API( Ptr )
  239. NewPtrSys                       (Size                   byteCount)                          ONEWORDINLINE(0xA51E);
  240. #endif  /* CALL_NOT_IN_CARBON */
  241.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  242.                                                                                             #pragma parameter __A0 NewPtrClear(__D0)
  243.                                                                                             #endif
  244. EXTERN_API( Ptr )
  245. NewPtrClear                     (Size                   byteCount)                          ONEWORDINLINE(0xA31E);
  246. #if CALL_NOT_IN_CARBON
  247.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  248.                                                                                             #pragma parameter __A0 NewPtrSysClear(__D0)
  249.                                                                                             #endif
  250. EXTERN_API( Ptr )
  251. NewPtrSysClear                  (Size                   byteCount)                          ONEWORDINLINE(0xA71E);
  252.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  253.                                                                                             #pragma parameter __A0 PtrZone(__A0)
  254.                                                                                             #endif
  255. EXTERN_API( THz )
  256. PtrZone                         (Ptr                    p)                                  ONEWORDINLINE(0xA148);
  257. #endif  /* CALL_NOT_IN_CARBON */
  258.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  259.                                                                                             #pragma parameter __D0 MaxBlock
  260.                                                                                             #endif
  261. EXTERN_API( long )
  262. MaxBlock                        (void)                                                      ONEWORDINLINE(0xA061);
  263. #if CALL_NOT_IN_CARBON
  264.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  265.                                                                                             #pragma parameter __D0 MaxBlockSys
  266.                                                                                             #endif
  267. EXTERN_API( long )
  268. MaxBlockSys                     (void)                                                      ONEWORDINLINE(0xA461);
  269. #endif  /* CALL_NOT_IN_CARBON */
  270.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  271.                                                                                             #pragma parameter __D0 StackSpace
  272.                                                                                             #endif
  273. EXTERN_API( long )
  274. StackSpace                      (void)                                                      ONEWORDINLINE(0xA065);
  275.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  276.                                                                                             #pragma parameter __A0 NewEmptyHandle
  277.                                                                                             #endif
  278. EXTERN_API( Handle )
  279. NewEmptyHandle                  (void)                                                      ONEWORDINLINE(0xA166);
  280. #if CALL_NOT_IN_CARBON
  281.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  282.                                                                                             #pragma parameter __A0 NewEmptyHandleSys
  283.                                                                                             #endif
  284. EXTERN_API( Handle )
  285. NewEmptyHandleSys               (void)                                                      ONEWORDINLINE(0xA566);
  286. #endif  /* CALL_NOT_IN_CARBON */
  287.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  288.                                                                                             #pragma parameter HLock(__A0)
  289.                                                                                             #endif
  290. EXTERN_API( void )
  291. HLock                           (Handle                 h)                                  ONEWORDINLINE(0xA029);
  292.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  293.                                                                                             #pragma parameter HUnlock(__A0)
  294.                                                                                             #endif
  295. EXTERN_API( void )
  296. HUnlock                         (Handle                 h)                                  ONEWORDINLINE(0xA02A);
  297.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  298.                                                                                             #pragma parameter HPurge(__A0)
  299.                                                                                             #endif
  300. EXTERN_API( void )
  301. HPurge                          (Handle                 h)                                  ONEWORDINLINE(0xA049);
  302.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  303.                                                                                             #pragma parameter HNoPurge(__A0)
  304.                                                                                             #endif
  305. EXTERN_API( void )
  306. HNoPurge                        (Handle                 h)                                  ONEWORDINLINE(0xA04A);
  307.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  308.                                                                                             #pragma parameter HLockHi(__A0)
  309.                                                                                             #endif
  310. EXTERN_API( void )
  311. HLockHi                         (Handle                 h)                                  TWOWORDINLINE(0xA064, 0xA029);
  312. EXTERN_API( Handle )
  313. TempNewHandle                   (Size                   logicalSize,
  314.                                  OSErr *                resultCode)                         THREEWORDINLINE(0x3F3C, 0x001D, 0xA88F);
  315. EXTERN_API( Size )
  316. TempMaxMem                      (Size *                 grow)                               THREEWORDINLINE(0x3F3C, 0x0015, 0xA88F);
  317. EXTERN_API( long )
  318. TempFreeMem                     (void)                                                      THREEWORDINLINE(0x3F3C, 0x0018, 0xA88F);
  319. #if CALL_NOT_IN_CARBON
  320. EXTERN_API( void )
  321. InitZone                        (GrowZoneUPP            pgrowZone,
  322.                                  short                  cmoreMasters,
  323.                                  void *                 limitPtr,
  324.                                  void *                 startPtr);
  325. #endif  /* CALL_NOT_IN_CARBON */
  326. #if CALL_NOT_IN_CARBON
  327.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  328.                                                                                             #pragma parameter SetZone(__A0)
  329.                                                                                             #endif
  330. EXTERN_API( void )
  331. SetZone                         (THz                    hz)                                 ONEWORDINLINE(0xA01B);
  332. #endif  /* CALL_NOT_IN_CARBON */
  333.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  334.                                                                                             #pragma parameter __D0 CompactMem(__D0)
  335.                                                                                             #endif
  336. EXTERN_API( Size )
  337. CompactMem                      (Size                   cbNeeded)                           ONEWORDINLINE(0xA04C);
  338. #if CALL_NOT_IN_CARBON
  339.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  340.                                                                                             #pragma parameter __D0 CompactMemSys(__D0)
  341.                                                                                             #endif
  342. EXTERN_API( Size )
  343. CompactMemSys                   (Size                   cbNeeded)                           ONEWORDINLINE(0xA44C);
  344. #endif  /* CALL_NOT_IN_CARBON */
  345.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  346.                                                                                             #pragma parameter PurgeMem(__D0)
  347.                                                                                             #endif
  348. EXTERN_API( void )
  349. PurgeMem                        (Size                   cbNeeded)                           ONEWORDINLINE(0xA04D);
  350. #if CALL_NOT_IN_CARBON
  351.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  352.                                                                                             #pragma parameter PurgeMemSys(__D0)
  353.                                                                                             #endif
  354. EXTERN_API( void )
  355. PurgeMemSys                     (Size                   cbNeeded)                           ONEWORDINLINE(0xA44D);
  356. #endif  /* CALL_NOT_IN_CARBON */
  357.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  358.                                                                                             #pragma parameter __D0 FreeMem
  359.                                                                                             #endif
  360. EXTERN_API( long )
  361. FreeMem                         (void)                                                      ONEWORDINLINE(0xA01C);
  362. #if CALL_NOT_IN_CARBON
  363.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  364.                                                                                             #pragma parameter __D0 FreeMemSys
  365.                                                                                             #endif
  366. EXTERN_API( long )
  367. FreeMemSys                      (void)                                                      ONEWORDINLINE(0xA41C);
  368. #endif  /* CALL_NOT_IN_CARBON */
  369.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  370.                                                                                             #pragma parameter ReserveMem(__D0)
  371.                                                                                             #endif
  372. EXTERN_API( void )
  373. ReserveMem                      (Size                   cbNeeded)                           ONEWORDINLINE(0xA040);
  374. #if CALL_NOT_IN_CARBON
  375.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  376.                                                                                             #pragma parameter ReserveMemSys(__D0)
  377.                                                                                             #endif
  378. EXTERN_API( void )
  379. ReserveMemSys                   (Size                   cbNeeded)                           ONEWORDINLINE(0xA440);
  380. #endif  /* CALL_NOT_IN_CARBON */
  381.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  382.                                                                                             #pragma parameter __D0 MaxMem(__A1)
  383.                                                                                             #endif
  384. EXTERN_API( Size )
  385. MaxMem                          (Size *                 grow)                               TWOWORDINLINE(0xA11D, 0x2288);
  386. #if CALL_NOT_IN_CARBON
  387.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  388.                                                                                             #pragma parameter __D0 MaxMemSys(__A1)
  389.                                                                                             #endif
  390. EXTERN_API( Size )
  391. MaxMemSys                       (Size *                 grow)                               TWOWORDINLINE(0xA51D, 0x2288);
  392. #endif  /* CALL_NOT_IN_CARBON */
  393.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  394.                                                                                             #pragma parameter SetGrowZone(__A0)
  395.                                                                                             #endif
  396. EXTERN_API( void )
  397. SetGrowZone                     (GrowZoneUPP            growZone)                           ONEWORDINLINE(0xA04B);
  398.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  399.                                                                                             #pragma parameter MoveHHi(__A0)
  400.                                                                                             #endif
  401. EXTERN_API( void )
  402. MoveHHi                         (Handle                 h)                                  ONEWORDINLINE(0xA064);
  403.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  404.                                                                                             #pragma parameter DisposePtr(__A0)
  405.                                                                                             #endif
  406. EXTERN_API( void )
  407. DisposePtr                      (Ptr                    p)                                  ONEWORDINLINE(0xA01F);
  408. EXTERN_API( Size )
  409. GetPtrSize                      (Ptr                    p);
  410.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  411.                                                                                             #pragma parameter SetPtrSize(__A0, __D0)
  412.                                                                                             #endif
  413. EXTERN_API( void )
  414. SetPtrSize                      (Ptr                    p,
  415.                                  Size                   newSize)                            ONEWORDINLINE(0xA020);
  416.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  417.                                                                                             #pragma parameter DisposeHandle(__A0)
  418.                                                                                             #endif
  419. EXTERN_API( void )
  420. DisposeHandle                   (Handle                 h)                                  ONEWORDINLINE(0xA023);
  421.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  422.                                                                                             #pragma parameter SetHandleSize(__A0, __D0)
  423.                                                                                             #endif
  424. EXTERN_API( void )
  425. SetHandleSize                   (Handle                 h,
  426.                                  Size                   newSize)                            ONEWORDINLINE(0xA024);
  427. /* 
  428.     NOTE
  429.     
  430.     GetHandleSize and GetPtrSize are documented in Inside Mac as returning 0 
  431.     in case of an error, but the traps actually return an error code in D0.
  432.     The glue sets D0 to 0 if an error occurred.
  433. */
  434. EXTERN_API( Size )
  435. GetHandleSize                   (Handle                 h);
  436. #if CALL_NOT_IN_CARBON
  437.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  438.                                                                                             #pragma parameter __D0 InlineGetHandleSize(__A0)
  439.                                                                                             #endif
  440. EXTERN_API( Size )
  441. InlineGetHandleSize             (Handle                 h)                                  ONEWORDINLINE(0xA025);
  442. #if !TARGET_OS_MAC
  443. #define InlineGetHandleSize GetHandleSize
  444. #endif
  445. #endif  /* CALL_NOT_IN_CARBON */
  446.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  447.                                                                                             #pragma parameter ReallocateHandle(__A0, __D0)
  448.                                                                                             #endif
  449. EXTERN_API( void )
  450. ReallocateHandle                (Handle                 h,
  451.                                  Size                   byteCount)                          ONEWORDINLINE(0xA027);
  452. #if CALL_NOT_IN_CARBON
  453.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  454.                                                                                             #pragma parameter ReallocateHandleSys(__A0, __D0)
  455.                                                                                             #endif
  456. EXTERN_API( void )
  457. ReallocateHandleSys             (Handle                 h,
  458.                                  Size                   byteCount)                          ONEWORDINLINE(0xA427);
  459. #endif  /* CALL_NOT_IN_CARBON */
  460.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  461.                                                                                             #pragma parameter EmptyHandle(__A0)
  462.                                                                                             #endif
  463. EXTERN_API( void )
  464. EmptyHandle                     (Handle                 h)                                  ONEWORDINLINE(0xA02B);
  465.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  466.                                                                                             #pragma parameter HSetRBit(__A0)
  467.                                                                                             #endif
  468. EXTERN_API( void )
  469. HSetRBit                        (Handle                 h)                                  ONEWORDINLINE(0xA067);
  470.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  471.                                                                                             #pragma parameter HClrRBit(__A0)
  472.                                                                                             #endif
  473. EXTERN_API( void )
  474. HClrRBit                        (Handle                 h)                                  ONEWORDINLINE(0xA068);
  475.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  476.                                                                                             #pragma parameter __D0 HGetState(__A0)
  477.                                                                                             #endif
  478. EXTERN_API( SInt8 )
  479. HGetState                       (Handle                 h)                                  ONEWORDINLINE(0xA069);
  480.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  481.                                                                                             #pragma parameter HSetState(__A0, __D0)
  482.                                                                                             #endif
  483. EXTERN_API( void )
  484. HSetState                       (Handle                 h,
  485.                                  SInt8                  flags)                              ONEWORDINLINE(0xA06A);
  486. EXTERN_API( void )
  487. PurgeSpace                      (long *                 total,
  488.                                  long *                 contig);
  489. /*
  490.     PurgeSpaceTotal and PurgeSpaceContiguous are currently only implement
  491.     on classic 68K.  The are the same as PurgeSpace() but return just
  492.     one value (either total space purgable or contiguous space purgable).
  493.     Begining in Mac OS 8.5 they are available in InterfaceLib.
  494. */
  495.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  496.                                                                                             #pragma parameter __A0 PurgeSpaceTotal
  497.                                                                                             #endif
  498. EXTERN_API( long )
  499. PurgeSpaceTotal                 (void)                                                      ONEWORDINLINE(0xA062);
  500.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  501.                                                                                             #pragma parameter __D0 PurgeSpaceContiguous
  502.                                                                                             #endif
  503. EXTERN_API( long )
  504. PurgeSpaceContiguous            (void)                                                      ONEWORDINLINE(0xA062);
  505. #if CALL_NOT_IN_CARBON
  506.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  507.                                                                                             #pragma parameter __A0 PurgeSpaceSysTotal
  508.                                                                                             #endif
  509. EXTERN_API( long )
  510. PurgeSpaceSysTotal              (void)                                                      ONEWORDINLINE(0xA562);
  511.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  512.                                                                                             #pragma parameter __D0 PurgeSpaceSysContiguous
  513.                                                                                             #endif
  514. EXTERN_API( long )
  515. PurgeSpaceSysContiguous         (void)                                                      ONEWORDINLINE(0xA562);
  516. /*****************************************************************************
  517.     The routines: 
  518.         BlockMoveUncached, BlockMoveDataUncached
  519.         BlockZero, BlockZeroUncached
  520.     
  521.     were first created for developers writing drivers. Originally they only
  522.     existed in DriverServicesLib.  Later they were added to InterfaceLib 
  523.     in PCI based PowerMacs.  MacOS 8.5 provides these routines in InterfaceLib
  524.     on all supported machines. 
  525.     
  526. *****************************************************************************/
  527. #endif  /* CALL_NOT_IN_CARBON */
  528.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  529.                                                                                             #pragma parameter BlockMove(__A0, __A1, __D0)
  530.                                                                                             #endif
  531. EXTERN_API( void )
  532. BlockMove                       (const void *           srcPtr,
  533.                                  void *                 destPtr,
  534.                                  Size                   byteCount)                          ONEWORDINLINE(0xA02E);
  535.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  536.                                                                                             #pragma parameter BlockMoveData(__A0, __A1, __D0)
  537.                                                                                             #endif
  538. EXTERN_API( void )
  539. BlockMoveData                   (const void *           srcPtr,
  540.                                  void *                 destPtr,
  541.                                  Size                   byteCount)                          ONEWORDINLINE(0xA22E);
  542. EXTERN_API_C( void )
  543. BlockMoveUncached               (const void *           srcPtr,
  544.                                  void *                 destPtr,
  545.                                  Size                   byteCount);
  546. EXTERN_API_C( void )
  547. BlockMoveDataUncached           (const void *           srcPtr,
  548.                                  void *                 destPtr,
  549.                                  Size                   byteCount);
  550. EXTERN_API_C( void )
  551. BlockZero                       (void *                 destPtr,
  552.                                  Size                   byteCount);
  553. EXTERN_API_C( void )
  554. BlockZeroUncached               (void *                 destPtr,
  555.                                  Size                   byteCount);
  556. #if CALL_NOT_IN_CARBON
  557. EXTERN_API( void )
  558. MaxApplZone                     (void)                                                      ONEWORDINLINE(0xA063);
  559.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  560.                                                                                             #pragma parameter SetApplBase(__A0)
  561.                                                                                             #endif
  562. EXTERN_API( void )
  563. SetApplBase                     (void *                 startPtr)                           ONEWORDINLINE(0xA057);
  564. #endif  /* CALL_NOT_IN_CARBON */
  565. EXTERN_API( void )
  566. MoreMasters                     (void)                                                      ONEWORDINLINE(0xA036);
  567. #if TARGET_API_MAC_CARBON
  568. EXTERN_API_C( void )
  569. MoreMasterPointers              (UInt32                 inCount);
  570. #endif  /* TARGET_API_MAC_CARBON */
  571. #if CALL_NOT_IN_CARBON
  572.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  573.                                                                                             #pragma parameter SetApplLimit(__A0)
  574.                                                                                             #endif
  575. EXTERN_API( void )
  576. SetApplLimit                    (void *                 zoneLimit)                          ONEWORDINLINE(0xA02D);
  577. EXTERN_API( void )
  578. InitApplZone                    (void)                                                      ONEWORDINLINE(0xA02C);
  579. /*  Temporary Memory routines renamed, but obsolete, in System 7.0 and later.  */
  580. #endif  /* CALL_NOT_IN_CARBON */
  581. EXTERN_API( void )
  582. TempHLock                       (Handle                 h,
  583.                                  OSErr *                resultCode)                         THREEWORDINLINE(0x3F3C, 0x001E, 0xA88F);
  584. EXTERN_API( void )
  585. TempHUnlock                     (Handle                 h,
  586.                                  OSErr *                resultCode)                         THREEWORDINLINE(0x3F3C, 0x001F, 0xA88F);
  587. EXTERN_API( void )
  588. TempDisposeHandle               (Handle                 h,
  589.                                  OSErr *                resultCode)                         THREEWORDINLINE(0x3F3C, 0x0020, 0xA88F);
  590. EXTERN_API( Ptr )
  591. TempTopMem                      (void)                                                      THREEWORDINLINE(0x3F3C, 0x0016, 0xA88F);
  592. #if CALL_NOT_IN_CARBON
  593.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  594.                                                                                             #pragma parameter __D0 HoldMemory(__A0, __A1)
  595.                                                                                             #endif
  596. EXTERN_API( OSErr )
  597. HoldMemory                      (void *                 address,
  598.                                  unsigned long          count)                              TWOWORDINLINE(0x7000, 0xA05C);
  599.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  600.                                                                                             #pragma parameter __D0 UnholdMemory(__A0, __A1)
  601.                                                                                             #endif
  602. EXTERN_API( OSErr )
  603. UnholdMemory                    (void *                 address,
  604.                                  unsigned long          count)                              TWOWORDINLINE(0x7001, 0xA05C);
  605.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  606.                                                                                             #pragma parameter __D0 LockMemory(__A0, __A1)
  607.                                                                                             #endif
  608. EXTERN_API( OSErr )
  609. LockMemory                      (void *                 address,
  610.                                  unsigned long          count)                              TWOWORDINLINE(0x7002, 0xA05C);
  611.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  612.                                                                                             #pragma parameter __D0 LockMemoryForOutput(__A0, __A1)
  613.                                                                                             #endif
  614. EXTERN_API( OSErr )
  615. LockMemoryForOutput             (void *                 address,
  616.                                  unsigned long          count)                              TWOWORDINLINE(0x700A, 0xA05C);
  617.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  618.                                                                                             #pragma parameter __D0 LockMemoryContiguous(__A0, __A1)
  619.                                                                                             #endif
  620. EXTERN_API( OSErr )
  621. LockMemoryContiguous            (void *                 address,
  622.                                  unsigned long          count)                              TWOWORDINLINE(0x7004, 0xA05C);
  623.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  624.                                                                                             #pragma parameter __D0 UnlockMemory(__A0, __A1)
  625.                                                                                             #endif
  626. EXTERN_API( OSErr )
  627. UnlockMemory                    (void *                 address,
  628.                                  unsigned long          count)                              TWOWORDINLINE(0x7003, 0xA05C);
  629.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  630.                                                                                             #pragma parameter __D0 MakeMemoryResident(__A0, __A1)
  631.                                                                                             #endif
  632. EXTERN_API( OSErr )
  633. MakeMemoryResident              (void *                 address,
  634.                                  unsigned long          count)                              TWOWORDINLINE(0x700B, 0xA05C);
  635.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  636.                                                                                             #pragma parameter __D0 ReleaseMemoryData(__A0, __A1)
  637.                                                                                             #endif
  638. EXTERN_API( OSErr )
  639. ReleaseMemoryData               (void *                 address,
  640.                                  unsigned long          count)                              TWOWORDINLINE(0x700C, 0xA05C);
  641.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  642.                                                                                             #pragma parameter __D0 MakeMemoryNonResident(__A0, __A1)
  643.                                                                                             #endif
  644. EXTERN_API( OSErr )
  645. MakeMemoryNonResident           (void *                 address,
  646.                                  unsigned long          count)                              TWOWORDINLINE(0x700D, 0xA05C);
  647.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  648.                                                                                             #pragma parameter __D0 FlushMemory(__A0, __A1)
  649.                                                                                             #endif
  650. EXTERN_API( OSErr )
  651. FlushMemory                     (void *                 address,
  652.                                  unsigned long          count)                              TWOWORDINLINE(0x700E, 0xA05C);
  653. #endif  /* CALL_NOT_IN_CARBON */
  654. #if CALL_NOT_IN_CARBON
  655. EXTERN_API( OSErr )
  656. GetPhysical                     (LogicalToPhysicalTable * addresses,
  657.                                  unsigned long *        physicalEntryCount);
  658. #endif  /* CALL_NOT_IN_CARBON */
  659. #if CALL_NOT_IN_CARBON
  660.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  661.                                                                                             #pragma parameter __D0 GetVolumeVirtualMemoryInfo(__A0)
  662.                                                                                             #endif
  663. EXTERN_API( OSErr )
  664. GetVolumeVirtualMemoryInfo      (VolumeVirtualMemoryInfoPtr  volVMInfo)                     TWOWORDINLINE(0x700F, 0xA05C);
  665.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  666.                                                                                             #pragma parameter __D0 DeferUserFn(__A0, __D0)
  667.                                                                                             #endif
  668. EXTERN_API( OSErr )
  669. DeferUserFn                     (UserFnUPP              userFunction,
  670.                                  void *                 argument)                           ONEWORDINLINE(0xA08F);
  671.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  672.                                                                                             #pragma parameter __D0 DebuggerGetMax
  673.                                                                                             #endif
  674. EXTERN_API( long )
  675. DebuggerGetMax                  (void)                                                      TWOWORDINLINE(0x7000, 0xA08D);
  676. EXTERN_API( void )
  677. DebuggerEnter                   (void)                                                      TWOWORDINLINE(0x7001, 0xA08D);
  678. EXTERN_API( void )
  679. DebuggerExit                    (void)                                                      TWOWORDINLINE(0x7002, 0xA08D);
  680. EXTERN_API( void )
  681. DebuggerPoll                    (void)                                                      TWOWORDINLINE(0x7003, 0xA08D);
  682.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  683.                                                                                             #pragma parameter __D0 GetPageState(__A0)
  684.                                                                                             #endif
  685. EXTERN_API( PageState )
  686. GetPageState                    (const void *           address)                            TWOWORDINLINE(0x7004, 0xA08D);
  687.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  688.                                                                                             #pragma parameter __D0 PageFaultFatal
  689.                                                                                             #endif
  690. EXTERN_API( Boolean )
  691. PageFaultFatal                  (void)                                                      TWOWORDINLINE(0x7005, 0xA08D);
  692.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  693.                                                                                             #pragma parameter __D0 DebuggerLockMemory(__A0, __A1)
  694.                                                                                             #endif
  695. EXTERN_API( OSErr )
  696. DebuggerLockMemory              (void *                 address,
  697.                                  unsigned long          count)                              TWOWORDINLINE(0x7006, 0xA08D);
  698.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  699.                                                                                             #pragma parameter __D0 DebuggerUnlockMemory(__A0, __A1)
  700.                                                                                             #endif
  701. EXTERN_API( OSErr )
  702. DebuggerUnlockMemory            (void *                 address,
  703.                                  unsigned long          count)                              TWOWORDINLINE(0x7007, 0xA08D);
  704.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  705.                                                                                             #pragma parameter __D0 EnterSupervisorMode
  706.                                                                                             #endif
  707. EXTERN_API( StatusRegisterContents )
  708. EnterSupervisorMode             (void)                                                      TWOWORDINLINE(0x7008, 0xA08D);
  709. /* 
  710.     StripAddress is a trap on classic 68K and the
  711.     identity function on PowerMacs and other OS's.
  712. */
  713. #if TARGET_OS_MAC && TARGET_CPU_68K
  714.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  715.                                                                                             #pragma parameter __D0 StripAddress(__D0)
  716.                                                                                             #endif
  717. EXTERN_API( Ptr )
  718. StripAddress                    (void *                 theAddress)                         ONEWORDINLINE(0xA055);
  719. #else
  720. #define StripAddress(x)     ((Ptr)(x))
  721. #endif
  722. /* 
  723.     Translate24To32 is a trap on classic 68K and the
  724.     identity function on PowerMacs and other OS's.
  725. */
  726. #if TARGET_OS_MAC && TARGET_CPU_68K
  727.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  728.                                                                                             #pragma parameter __D0 Translate24To32(__D0)
  729.                                                                                             #endif
  730. EXTERN_API( Ptr )
  731. Translate24To32                 (void *                 addr24)                             ONEWORDINLINE(0xA091);
  732. #else
  733. #define Translate24To32(x)      ((Ptr)(x))
  734. #endif
  735. #endif  /* CALL_NOT_IN_CARBON */
  736. EXTERN_API( OSErr )
  737. HandToHand                      (Handle *               theHndl);
  738.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  739.                                                                                             #pragma parameter __D0 PtrToXHand(__A0, __A1, __D0)
  740.                                                                                             #endif
  741. EXTERN_API( OSErr )
  742. PtrToXHand                      (const void *           srcPtr,
  743.                                  Handle                 dstHndl,
  744.                                  long                   size)                               ONEWORDINLINE(0xA9E2);
  745. EXTERN_API( OSErr )
  746. PtrToHand                       (const void *           srcPtr,
  747.                                  Handle *               dstHndl,
  748.                                  long                   size);
  749.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  750.                                                                                             #pragma parameter __D0 HandAndHand(__A0, __A1)
  751.                                                                                             #endif
  752. EXTERN_API( OSErr )
  753. HandAndHand                     (Handle                 hand1,
  754.                                  Handle                 hand2)                              ONEWORDINLINE(0xA9E4);
  755.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  756.                                                                                             #pragma parameter __D0 PtrAndHand(__A0, __A1, __D0)
  757.                                                                                             #endif
  758. EXTERN_API( OSErr )
  759. PtrAndHand                      (const void *           ptr1,
  760.                                  Handle                 hand2,
  761.                                  long                   size)                               ONEWORDINLINE(0xA9EF);
  762. /* Carbon routines to aid in debugging. */
  763. /* Checks all applicable heaps for validity */
  764. EXTERN_API( Boolean )
  765. CheckAllHeaps                   (void);
  766. /* Checks the application heap for validity */
  767. EXTERN_API( Boolean )
  768. IsHeapValid                     (void);
  769. /* It is invalid to pass a NULL or an empty Handle to IsHandleValid */
  770. EXTERN_API( Boolean )
  771. IsHandleValid                   (Handle                 h);
  772. /* It is invalid to pass a NULL Pointer to IsPointerValid */
  773. EXTERN_API( Boolean )
  774. IsPointerValid                  (Ptr                    p);
  775. #if OLDROUTINENAMES
  776. #define ApplicZone() ApplicationZone()
  777. #define MFTempNewHandle(logicalSize, resultCode) TempNewHandle(logicalSize, resultCode)
  778. #define MFMaxMem(grow) TempMaxMem(grow)
  779. #define MFFreeMem() TempFreeMem()
  780. #define MFTempHLock(h, resultCode) TempHLock(h, resultCode)
  781. #define MFTempHUnlock(h, resultCode) TempHUnlock(h, resultCode)
  782. #define MFTempDisposHandle(h, resultCode) TempDisposeHandle(h, resultCode)
  783. #define MFTopMem() TempTopMem()
  784. #define ResrvMem(cbNeeded) ReserveMem(cbNeeded)
  785. #define DisposPtr(p) DisposePtr(p)
  786. #define DisposHandle(h) DisposeHandle(h)
  787. #define ReallocHandle(h, byteCount) ReallocateHandle(h, byteCount)
  788. #endif  /* OLDROUTINENAMES */
  789. #if PRAGMA_STRUCT_ALIGN
  790.     #pragma options align=reset
  791. #elif PRAGMA_STRUCT_PACKPUSH
  792.     #pragma pack(pop)
  793. #elif PRAGMA_STRUCT_PACK
  794.     #pragma pack()
  795. #endif
  796. #ifdef PRAGMA_IMPORT_OFF
  797. #pragma import off
  798. #elif PRAGMA_IMPORT
  799. #pragma import reset
  800. #endif
  801. #ifdef __cplusplus
  802. }
  803. #endif
  804. #endif /* __MACMEMORY__ */