Mac OS 9
MacMemory.h
Go to the documentation of this file.
1 
19 #ifndef __MACMEMORY__
20 #define __MACMEMORY__
21 
22 #ifndef __MACTYPES__
23 #include <MacTypes.h>
24 #endif
25 
26 #ifndef __MIXEDMODE__
27 #include <MixedMode.h>
28 #endif
29 
30 #if PRAGMA_ONCE
31 #pragma once
32 #endif
33 
34 #ifdef __cplusplus
35 extern "C"
36 {
37 #endif
38 
39 #if PRAGMA_IMPORT
40 #pragma import on
41 #endif
42 
43 #if PRAGMA_STRUCT_ALIGN
44 #pragma options align = mac68k
45 #elif PRAGMA_STRUCT_PACKPUSH
46 #pragma pack(push, 2)
47 #elif PRAGMA_STRUCT_PACK
48 #pragma pack(2)
49 #endif
50 
51  enum
52  {
53  maxSize = 0x7FFFFFF0 /*the largest block possible*/
54  };
55 
56  enum
57  {
58  defaultPhysicalEntryCount = 8
59  };
60 
61  enum
62  {
63  /* values returned from the GetPageState function */
64  kPageInMemory = 0,
65  kPageOnDisk = 1,
66  kNotPaged = 2
67  };
68 
69  enum
70  {
71  /* masks for Zone->heapType field */
72  k32BitHeap = 1, /* valid in all Memory Managers */
73  kNewStyleHeap = 2, /* true if new Heap Manager is present */
74  kNewDebugHeap =
75  4 /* true if new Heap Manager is running in debug mode on this heap */
76  };
77 
78  /* bits for use with HGetState/HSetState*/
79  enum
80  {
81  kHandleIsResourceBit = 5,
82  kHandlePurgeableBit = 6,
83  kHandleLockedBit = 7
84  };
85 
86  /* masks for use with HGetState/HSetState*/
87  enum
88  {
89  kHandleIsResourceMask = 0x20,
90  kHandlePurgeableMask = 0x40,
91  kHandleLockedMask = 0x80
92  };
93 
94  typedef CALLBACK_API(long, GrowZoneProcPtr)(Size cbNeeded);
95  typedef CALLBACK_API(void, PurgeProcPtr)(Handle blockToPurge);
96  typedef CALLBACK_API_REGISTER68K(void, UserFnProcPtr, (void *parameter));
97  typedef STACK_UPP_TYPE(GrowZoneProcPtr) GrowZoneUPP;
98  typedef STACK_UPP_TYPE(PurgeProcPtr) PurgeUPP;
99  typedef REGISTER_UPP_TYPE(UserFnProcPtr) UserFnUPP;
100  struct Zone
101  {
102  Ptr bkLim;
103  Ptr purgePtr;
104  Ptr hFstFree;
105  long zcbFree;
106  GrowZoneUPP gzProc;
107  short moreMast;
108  short flags;
109  short cntRel;
110  short maxRel;
111  short cntNRel;
112  SInt8 heapType; /* previously "maxNRel", now holds flags (e.g. k32BitHeap)*/
113  SInt8 unused;
114  short cntEmpty;
115  short cntHandles;
116  long minCBFree;
117  PurgeUPP purgeProc;
118  Ptr sparePtr;
119  Ptr allocPtr;
120  short heapData;
121  };
122  typedef struct Zone Zone;
123  typedef Zone *THz;
124  typedef THz *THzPtr;
125  struct MemoryBlock
126  {
127  void *address;
128  unsigned long count;
129  };
130  typedef struct MemoryBlock MemoryBlock;
132  {
133  MemoryBlock logical;
134  MemoryBlock physical[8];
135  };
137 
138  typedef short PageState;
139  typedef short StatusRegisterContents;
140  enum
141  {
142  kVolumeVirtualMemoryInfoVersion1 =
143  1 /* first version of VolumeVirtualMemoryInfo*/
144  };
145 
147  {
148  PBVersion
149  version; /* Input: Version of the VolumeVirtualMemoryInfo structure*/
150  SInt16 volumeRefNum; /* Input: volume reference number*/
151  Boolean inUse; /* output: true if volume is currently used for file mapping*/
152  UInt8 _fill;
153  UInt32 vmOptions; /* output: tells what volume can support (same as
154  DriverGestaltVMOptionsResponse vmOptions bits in
155  DriverGestalt)*/
156  /* end of kVolumeVirtualMemoryInfoVersion1 structure*/
157  };
168  GrowZoneUPP
169  NewGrowZoneUPP(GrowZoneProcPtr userRoutine);
170 #if !OPAQUE_UPP_TYPES
171  enum
172  {
173  uppGrowZoneProcInfo = 0x000000F0
174  }; /* pascal 4_bytes Func(4_bytes) */
175 #ifdef __cplusplus
176  inline GrowZoneUPP NewGrowZoneUPP(GrowZoneProcPtr userRoutine)
177  {
178  return (GrowZoneUPP)NewRoutineDescriptor(
179  (ProcPtr)(userRoutine), uppGrowZoneProcInfo, GetCurrentArchitecture());
180  }
181 #else
182 #define NewGrowZoneUPP(userRoutine) \
183  (GrowZoneUPP) NewRoutineDescriptor( \
184  (ProcPtr)(userRoutine), uppGrowZoneProcInfo, GetCurrentArchitecture())
185 #endif
186 #endif
187 
196  PurgeUPP
197  NewPurgeUPP(PurgeProcPtr userRoutine);
198 #if !OPAQUE_UPP_TYPES
199  enum
200  {
201  uppPurgeProcInfo = 0x000000C0
202  }; /* pascal no_return_value Func(4_bytes) */
203 #ifdef __cplusplus
204  inline PurgeUPP NewPurgeUPP(PurgeProcPtr userRoutine)
205  {
206  return (PurgeUPP)NewRoutineDescriptor(
207  (ProcPtr)(userRoutine), uppPurgeProcInfo, GetCurrentArchitecture());
208  }
209 #else
210 #define NewPurgeUPP(userRoutine) \
211  (PurgeUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppPurgeProcInfo, \
212  GetCurrentArchitecture())
213 #endif
214 #endif
215 
224  UserFnUPP
225  NewUserFnUPP(UserFnProcPtr userRoutine);
226 #if !OPAQUE_UPP_TYPES
227  enum
228  {
229  uppUserFnProcInfo = 0x00009802
230  }; /* register no_return_value Func(4_bytes:A0) */
231 #ifdef __cplusplus
232  inline UserFnUPP NewUserFnUPP(UserFnProcPtr userRoutine)
233  {
234  return (UserFnUPP)NewRoutineDescriptor(
235  (ProcPtr)(userRoutine), uppUserFnProcInfo, GetCurrentArchitecture());
236  }
237 #else
238 #define NewUserFnUPP(userRoutine) \
239  (UserFnUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppUserFnProcInfo, \
240  GetCurrentArchitecture())
241 #endif
242 #endif
243 
252  void
253  DisposeGrowZoneUPP(GrowZoneUPP userUPP);
254 #if !OPAQUE_UPP_TYPES
255 #ifdef __cplusplus
256  inline void DisposeGrowZoneUPP(GrowZoneUPP userUPP)
257  {
258  DisposeRoutineDescriptor((UniversalProcPtr)userUPP);
259  }
260 #else
261 #define DisposeGrowZoneUPP(userUPP) DisposeRoutineDescriptor(userUPP)
262 #endif
263 #endif
264 
273  void
274  DisposePurgeUPP(PurgeUPP userUPP);
275 #if !OPAQUE_UPP_TYPES
276 #ifdef __cplusplus
277  inline void DisposePurgeUPP(PurgeUPP userUPP)
278  {
279  DisposeRoutineDescriptor((UniversalProcPtr)userUPP);
280  }
281 #else
282 #define DisposePurgeUPP(userUPP) DisposeRoutineDescriptor(userUPP)
283 #endif
284 #endif
285 
294  void
295  DisposeUserFnUPP(UserFnUPP userUPP);
296 #if !OPAQUE_UPP_TYPES
297 #ifdef __cplusplus
298  inline void DisposeUserFnUPP(UserFnUPP userUPP)
299  {
300  DisposeRoutineDescriptor((UniversalProcPtr)userUPP);
301  }
302 #else
303 #define DisposeUserFnUPP(userUPP) DisposeRoutineDescriptor(userUPP)
304 #endif
305 #endif
306 
315  long
316  InvokeGrowZoneUPP(Size cbNeeded, GrowZoneUPP userUPP);
317 #if !OPAQUE_UPP_TYPES
318 #ifdef __cplusplus
319  inline long InvokeGrowZoneUPP(Size cbNeeded, GrowZoneUPP userUPP)
320  {
321  return (long)CALL_ONE_PARAMETER_UPP(userUPP, uppGrowZoneProcInfo, cbNeeded);
322  }
323 #else
324 #define InvokeGrowZoneUPP(cbNeeded, userUPP) \
325  (long)CALL_ONE_PARAMETER_UPP((userUPP), uppGrowZoneProcInfo, (cbNeeded))
326 #endif
327 #endif
328 
337  void
338  InvokePurgeUPP(Handle blockToPurge, PurgeUPP userUPP);
339 #if !OPAQUE_UPP_TYPES
340 #ifdef __cplusplus
341  inline void InvokePurgeUPP(Handle blockToPurge, PurgeUPP userUPP)
342  {
343  CALL_ONE_PARAMETER_UPP(userUPP, uppPurgeProcInfo, blockToPurge);
344  }
345 #else
346 #define InvokePurgeUPP(blockToPurge, userUPP) \
347  CALL_ONE_PARAMETER_UPP((userUPP), uppPurgeProcInfo, (blockToPurge))
348 #endif
349 #endif
350 
359 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
360 #pragma parameter InvokeUserFnUPP(__A0, __A1)
361 #endif
362  void
363  InvokeUserFnUPP(void *parameter, UserFnUPP userUPP);
364 #if !OPAQUE_UPP_TYPES && \
365  (!TARGET_OS_MAC || !TARGET_CPU_68K || TARGET_RT_MAC_CFM)
366 #ifdef __cplusplus
367  inline void InvokeUserFnUPP(void *parameter, UserFnUPP userUPP)
368  {
369  CALL_ONE_PARAMETER_UPP(userUPP, uppUserFnProcInfo, parameter);
370  }
371 #else
372 #define InvokeUserFnUPP(parameter, userUPP) \
373  CALL_ONE_PARAMETER_UPP((userUPP), uppUserFnProcInfo, (parameter))
374 #endif
375 #endif
376 
377 #if CALL_NOT_IN_CARBON || OLDROUTINENAMES
378 /* support for pre-Carbon UPP routines: New...Proc and Call...Proc */
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)
388 #endif /* CALL_NOT_IN_CARBON */
389 
390 #if CALL_NOT_IN_CARBON
391 
409  Ptr
411 
427  THz
428  SystemZone(void);
429 
438  THz
440 
441 #endif /* CALL_NOT_IN_CARBON */
442 
461  Handle
462  GZSaveHnd(void);
463 
494  Ptr
495  TopMem(void);
496 
521  if (MemErr)
522  {
523  ...process the error...
524  }
525 ASM programs can check for return code values in the low word of the D0
526 register (with some exceptions).
527 </pre>
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
532  */
533 OSErr
534 MemError(void);
535 
536 #if CALL_NOT_IN_CARBON
537 
554 oldMoreMast = TheZone->moreMast; /* get old value of moreMast */
555 TheZone->moreMast = numMastPtrs; /* put the value we want in */
556 /* zone header */
557 MoreMasters(); /* allocate the master pointers */
558 TheZone->moreMast = oldMoreMast; /* restore old val of moreMast */
559 }
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
564  later
565  * \carbon_lib not available * \mac_os_x not available *
566  /
567 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
568 #pragma parameter __A0 GetZone
569 #endif
570  THz
571  GetZone(void);
572 
573 #endif /* CALL_NOT_IN_CARBON */
574 
583 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
584 #pragma parameter __A0 NewHandle(__D0)
585 #endif
586 Handle
587 NewHandle(Size byteCount);
588 
589 #if CALL_NOT_IN_CARBON
598 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
599 #pragma parameter __A0 NewHandleSys(__D0)
600 #endif
601 Handle
602 NewHandleSys(Size byteCount);
603 
604 #endif /* CALL_NOT_IN_CARBON */
605 
614 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
615 #pragma parameter __A0 NewHandleClear(__D0)
616 #endif
617 Handle
618 NewHandleClear(Size byteCount);
619 
620 #if CALL_NOT_IN_CARBON
629 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
630 #pragma parameter __A0 NewHandleSysClear(__D0)
631 #endif
632 Handle
633 NewHandleSysClear(Size byteCount);
634 
658 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
659 #pragma parameter __A0 HandleZone(__A0)
660 #endif
661 THz
662 HandleZone(Handle h);
663 
664 #endif /* CALL_NOT_IN_CARBON */
665 
674 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
675 #pragma parameter __A0 RecoverHandle(__A0)
676 #endif
677 Handle
679 
680 #if CALL_NOT_IN_CARBON
689 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
690 #pragma parameter __A0 RecoverHandleSys(__A0)
691 #endif
692 Handle
694 
695 #endif /* CALL_NOT_IN_CARBON */
696 
705 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
706 #pragma parameter __A0 NewPtr(__D0)
707 #endif
708 Ptr
709 NewPtr(Size byteCount);
710 
711 #if CALL_NOT_IN_CARBON
720 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
721 #pragma parameter __A0 NewPtrSys(__D0)
722 #endif
723 Ptr
724 NewPtrSys(Size byteCount);
725 
726 #endif /* CALL_NOT_IN_CARBON */
727 
736 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
737 #pragma parameter __A0 NewPtrClear(__D0)
738 #endif
739 Ptr
740 NewPtrClear(Size byteCount);
741 
742 #if CALL_NOT_IN_CARBON
751 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
752 #pragma parameter __A0 NewPtrSysClear(__D0)
753 #endif
754 Ptr
755 NewPtrSysClear(Size byteCount);
756 
777 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
778 #pragma parameter __A0 PtrZone(__A0)
779 #endif
780 THz
781 PtrZone(Ptr p);
782 
783 #endif /* CALL_NOT_IN_CARBON */
784 
812 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
813 #pragma parameter __D0 MaxBlock
814 #endif
815 long
816 MaxBlock(void);
817 
818 #if CALL_NOT_IN_CARBON
827 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
828 #pragma parameter __D0 MaxBlockSys
829 #endif
830 long
832 
833 #endif /* CALL_NOT_IN_CARBON */
834 
863 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
864 #pragma parameter __D0 StackSpace
865 #endif
866 long
868 
877 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
878 #pragma parameter __A0 NewEmptyHandle
879 #endif
880 Handle
882 
883 #if CALL_NOT_IN_CARBON
892 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
893 #pragma parameter __A0 NewEmptyHandleSys
894 #endif
895 Handle
897 
898 #endif /* CALL_NOT_IN_CARBON */
899 
927 FrameRect(&r); /* this may move unlocked data...*/
928 x = msp->myField; /* making msp invalid */
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 */
941 FrameRect(&r);
942 </ pre>
943  * \copyright THINK Reference © 1991 - 1992 Symantec Corporation
944  * \non_carbon_cfm in InterfaceLib 7.1 and
945  later
946  * \carbon_lib in CarbonLib 1.0 and
947  later
948  * \mac_os_x in version 10.0 and
949  later
950  * /
951 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
952 #pragma parameter HLock(__A0)
953 #endif
954  void
955  HLock(Handle h);
956 
984 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
985 #pragma parameter HUnlock(__A0)
986 #endif
987 void
988 HUnlock(Handle h);
989 
1011 HPurge(myHandle); /* allow purge */
1012 .
1013  : if (*myHandle == 0)
1014 { /* data has been purged */
1015  ReallocHandle(myHandle, 1000); /* get some storage */
1016  .
1017  ./* regenerate lost data; load resource, etc. */
1018  .
1019 }
1020 HNoPurge(myHandle); /* don't allow purge now */
1021 .
1022 :
1023 Use HNoPurge to undo the effect of this function (first be sure that the
1024 handle hasn't been purged!).
1025 </pre>
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
1030  */
1031 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1032 #pragma parameter HPurge(__A0)
1033 #endif
1034 void
1035 HPurge(Handle h);
1036 
1037 
1055 .
1056 :
1057 if ( *myHandle == 0 ) { /* it got purged */
1058  ReallocHandle(myHandle, MYH_SIZE);
1059  ... regenerate the handle's data ...
1060 }
1061 HNoPurge ( myHandle );
1062 </pre>
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
1067  */
1068 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1069 #pragma parameter HNoPurge(__A0)
1070 #endif
1071 void
1072 HNoPurge(Handle h);
1073 
1082 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1083 #pragma parameter HLockHi(__A0)
1084 #endif
1085 void
1086 HLockHi(Handle h);
1087 
1088 
1105 Handle
1106 TempNewHandle(Size logicalSize, OSErr *resultCode);
1107 
1108 
1122 Size
1123 TempMaxMem(Size *grow);
1124 
1125 
1139 long
1141 
1142 #if CALL_NOT_IN_CARBON
1151 void
1152 InitZone(GrowZoneUPP pgrowZone, short cmoreMasters, void *limitPtr,
1153  void *startPtr);
1154 
1155 #endif /* CALL_NOT_IN_CARBON */
1156 
1157 #if CALL_NOT_IN_CARBON
1158 
1183 myHandle = (myType) NewHandle ( sizeof( myType) );
1184 SetZone ( ApplicZone () ); /* application heap current */
1185 (*myHandle)->myField = myValue; /* store a value in system heap */
1186 </pre>
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
1191  */
1192 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1193 #pragma parameter SetZone(__A0)
1194 #endif
1195 void
1196 SetZone(THz hz);
1197 
1198 #endif /* CALL_NOT_IN_CARBON */
1199 
1208 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1209 #pragma parameter __D0 CompactMem(__D0)
1210 #endif
1211 Size
1212 CompactMem(Size cbNeeded);
1213 
1214 #if CALL_NOT_IN_CARBON
1223 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1224 #pragma parameter __D0 CompactMemSys(__D0)
1225 #endif
1226 Size
1227 CompactMemSys(Size cbNeeded);
1228 
1229 #endif /* CALL_NOT_IN_CARBON */
1230 
1239 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1240 #pragma parameter PurgeMem(__D0)
1241 #endif
1242 void
1243 PurgeMem(Size cbNeeded);
1244 
1245 #if CALL_NOT_IN_CARBON
1254 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1255 #pragma parameter PurgeMemSys(__D0)
1256 #endif
1257 void
1258 PurgeMemSys(Size cbNeeded);
1259 
1260 #endif /* CALL_NOT_IN_CARBON */
1261 
1270 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1271 #pragma parameter __D0 FreeMem
1272 #endif
1273 long
1274 FreeMem(void);
1275 
1276 #if CALL_NOT_IN_CARBON
1285 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1286 #pragma parameter __D0 FreeMemSys
1287 #endif
1288 long
1290 
1291 #endif /* CALL_NOT_IN_CARBON */
1292 
1301 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1302 #pragma parameter ReserveMem(__D0)
1303 #endif
1304 void
1305 ReserveMem(Size cbNeeded);
1306 
1307 #if CALL_NOT_IN_CARBON
1316 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1317 #pragma parameter ReserveMemSys(__D0)
1318 #endif
1319 void
1320 ReserveMemSys(Size cbNeeded);
1321 
1322 #endif /* CALL_NOT_IN_CARBON */
1323 
1332 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1333 #pragma parameter __D0 MaxMem(__A1)
1334 #endif
1335 Size
1336 MaxMem(Size *grow);
1337 
1338 #if CALL_NOT_IN_CARBON
1347 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1348 #pragma parameter __D0 MaxMemSys(__A1)
1349 #endif
1350 Size
1351 MaxMemSys(Size *grow);
1352 
1353 #endif /* CALL_NOT_IN_CARBON */
1354 
1355 
1378 .
1379 .Attempt to free or unlock memory . . .
1380 .. . . but don't alter saveHandle
1381 .
1382 return( 0 ); /* zero if unable to free or unlock any memory */
1383 return( 1 ); /* non-zero if able to make some progress */
1384 }
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
1396 </pre>
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
1401  */
1402 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1403 #pragma parameter SetGrowZone(__A0)
1404 #endif
1405 void
1406 SetGrowZone(GrowZoneUPP growZone);
1407 
1416 GrowZoneUPP
1417 GetGrowZone(void);
1418 
1427 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1428 #pragma parameter MoveHHi(__A0)
1429 #endif
1430 void
1431 MoveHHi(Handle h);
1432 
1441 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1442 #pragma parameter DisposePtr(__A0)
1443 #endif
1444 void
1445 DisposePtr(Ptr p);
1446 
1463 Size
1464 GetPtrSize(Ptr p);
1465 
1474 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1475 #pragma parameter SetPtrSize(__A0, __D0)
1476 #endif
1477 void
1478 SetPtrSize(Ptr p, Size newSize);
1479 
1488 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1489 #pragma parameter DisposeHandle(__A0)
1490 #endif
1491 void
1492 DisposeHandle(Handle h);
1493 
1502 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1503 #pragma parameter SetHandleSize(__A0, __D0)
1504 #endif
1505 void
1506 SetHandleSize(Handle h, Size newSize);
1507 
1541 Size
1542 GetHandleSize(Handle h);
1543 
1544 #if CALL_NOT_IN_CARBON
1553 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1554 #pragma parameter __D0 InlineGetHandleSize(__A0)
1555 #endif
1556 Size
1557 InlineGetHandleSize(Handle h);
1558 
1559 #endif /* CALL_NOT_IN_CARBON */
1560 
1569 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1570 #pragma parameter ReallocateHandle(__A0, __D0)
1571 #endif
1572 void
1573 ReallocateHandle(Handle h, Size byteCount);
1574 
1575 #if CALL_NOT_IN_CARBON
1584 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1585 #pragma parameter ReallocateHandleSys(__A0, __D0)
1586 #endif
1587 void
1588 ReallocateHandleSys(Handle h, Size byteCount);
1589 
1590 #endif /* CALL_NOT_IN_CARBON */
1591 
1600 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1601 #pragma parameter EmptyHandle(__A0)
1602 #endif
1603 void
1604 EmptyHandle(Handle h);
1605 
1631 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1632 #pragma parameter HSetRBit(__A0)
1633 #endif
1634 void
1635 HSetRBit(Handle h);
1636 
1660 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1661 #pragma parameter HClrRBit(__A0)
1662 #endif
1663 void
1664 HClrRBit(Handle h);
1665 
1690 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1691 #pragma parameter __D0 HGetState(__A0)
1692 #endif
1693 SInt8
1694 HGetState(Handle h);
1695 
1704 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1705 #pragma parameter HSetState(__A0, __D0)
1706 #endif
1707 void
1708 HSetState(Handle h, SInt8 flags);
1709 
1718 void
1719 PurgeSpace(long *total, long *contig);
1720 
1735 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1736 #pragma parameter __A0 PurgeSpaceTotal
1737 #endif
1738 long
1739 PurgeSpaceTotal(void);
1740 
1749 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1750 #pragma parameter __D0 PurgeSpaceContiguous
1751 #endif
1752 long
1753 PurgeSpaceContiguous(void);
1754 
1755 #if CALL_NOT_IN_CARBON
1764 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1765 #pragma parameter __A0 PurgeSpaceSysTotal
1766 #endif
1767 long
1768 PurgeSpaceSysTotal(void);
1769 
1778 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1779 #pragma parameter __D0 PurgeSpaceSysContiguous
1780 #endif
1781 long
1782 PurgeSpaceSysContiguous(void);
1783 
1784 /*****************************************************************************
1785 
1786  The routines:
1787 
1788  BlockMoveUncached, BlockMoveDataUncached
1789  BlockZero, BlockZeroUncached
1790 
1791  were first created for developers writing drivers. Originally they only
1792  existed in DriverServicesLib. Later they were added to InterfaceLib
1793  in PCI based PowerMacs. MacOS 8.5 provides these routines in InterfaceLib
1794  on all supported machines.
1795 
1796 *****************************************************************************/
1797 #endif /* CALL_NOT_IN_CARBON */
1798 
1836 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1837 #pragma parameter BlockMove(__A0, __A1, __D0)
1838 #endif
1839 void
1840 BlockMove(const void *srcPtr, void *destPtr, Size byteCount);
1841 
1850 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1851 #pragma parameter BlockMoveData(__A0, __A1, __D0)
1852 #endif
1853 void
1854 BlockMoveData(const void *srcPtr, void *destPtr, Size byteCount);
1855 
1864 void
1865 BlockMoveUncached(const void *srcPtr, void *destPtr, Size byteCount);
1866 
1875 void
1876 BlockMoveDataUncached(const void *srcPtr, void *destPtr, Size byteCount);
1877 
1886 void
1887 BlockZero(void *destPtr, Size byteCount);
1888 
1897 void
1898 BlockZeroUncached(void *destPtr, Size byteCount);
1899 
1900 #if CALL_NOT_IN_CARBON
1901 
1920 void
1921 MaxApplZone(void);
1922 
1931 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1932 #pragma parameter SetApplBase(__A0)
1933 #endif
1934 void
1935 SetApplBase(void *startPtr);
1936 
1937 #endif /* CALL_NOT_IN_CARBON */
1938 
1947 void
1948 MoreMasters(void);
1949 
1958 void
1959 MoreMasterPointers(UInt32 inCount);
1960 
1961 #if CALL_NOT_IN_CARBON
1962 
1991 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
1992 #pragma parameter SetApplLimit(__A0)
1993 #endif
1994 void
1995 SetApplLimit(void *zoneLimit);
1996 
2005 void
2006 InitApplZone(void);
2007 
2008 /* Temporary Memory routines renamed, but obsolete, in System 7.0 and later. */
2009 #endif /* CALL_NOT_IN_CARBON */
2010 
2029 void
2030 TempHLock(Handle h, OSErr *resultCode);
2031 
2051 void
2052 TempHUnlock(Handle h, OSErr *resultCode);
2053 
2071 void
2072 TempDisposeHandle(Handle h, OSErr *resultCode);
2073 
2088 Ptr
2089 TempTopMem(void);
2090 
2116 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
2117 #pragma parameter __D0 HoldMemory(__A0, __A1)
2118 #endif
2119 OSErr
2120 HoldMemory(void *address, unsigned long count);
2121 
2148 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
2149 #pragma parameter __D0 UnholdMemory(__A0, __A1)
2150 #endif
2151 OSErr
2152 UnholdMemory(void *address, unsigned long count);
2153 
2154 #if CALL_NOT_IN_CARBON
2155 
2180 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
2181 #pragma parameter __D0 LockMemory(__A0, __A1)
2182 #endif
2183 OSErr
2184 LockMemory(void *address, unsigned long count);
2185 
2194 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
2195 #pragma parameter __D0 LockMemoryForOutput(__A0, __A1)
2196 #endif
2197 OSErr
2198 LockMemoryForOutput(void *address, unsigned long count);
2199 
2227 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
2228 #pragma parameter __D0 LockMemoryContiguous(__A0, __A1)
2229 #endif
2230 OSErr
2231 LockMemoryContiguous(void *address, unsigned long count);
2232 
2257 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
2258 #pragma parameter __D0 UnlockMemory(__A0, __A1)
2259 #endif
2260 OSErr
2261 UnlockMemory(void *address, unsigned long count);
2262 
2263 #endif /* CALL_NOT_IN_CARBON */
2264 
2273 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
2274 #pragma parameter __D0 MakeMemoryResident(__A0, __A1)
2275 #endif
2276 OSErr
2277 MakeMemoryResident(void *address, unsigned long count);
2278 
2287 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
2288 #pragma parameter __D0 ReleaseMemoryData(__A0, __A1)
2289 #endif
2290 OSErr
2291 ReleaseMemoryData(void *address, unsigned long count);
2292 
2301 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
2302 #pragma parameter __D0 MakeMemoryNonResident(__A0, __A1)
2303 #endif
2304 OSErr
2305 MakeMemoryNonResident(void *address, unsigned long count);
2306 
2315 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
2316 #pragma parameter __D0 FlushMemory(__A0, __A1)
2317 #endif
2318 OSErr
2319 FlushMemory(void *address, unsigned long count);
2320 
2321 #if CALL_NOT_IN_CARBON
2322 
2350 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
2351 #pragma parameter __D0 GetPhysical(__A0, __A1)
2352 #endif
2353 OSErr
2354 GetPhysical(LogicalToPhysicalTable *addresses,
2355  unsigned long *physicalEntryCount);
2356 
2357 #endif /* CALL_NOT_IN_CARBON */
2358 
2359 #if CALL_NOT_IN_CARBON
2368 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
2369 #pragma parameter __D0 GetVolumeVirtualMemoryInfo(__A0)
2370 #endif
2371 OSErr
2372 GetVolumeVirtualMemoryInfo(VolumeVirtualMemoryInfoPtr volVMInfo);
2373 
2401 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
2402 #pragma parameter __D0 DeferUserFn(__A0, __D0)
2403 #endif
2404 OSErr
2405 DeferUserFn(UserFnUPP userFunction, void *argument);
2406 
2423 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
2424 #pragma parameter __D0 DebuggerGetMax
2425 #endif
2426 long
2427 DebuggerGetMax(void);
2428 
2442 void
2443 DebuggerEnter(void);
2444 
2458 void
2459 DebuggerExit(void);
2460 
2473 void
2474 DebuggerPoll(void);
2475 
2492 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
2493 #pragma parameter __D0 GetPageState(__A0)
2494 #endif
2495 PageState
2496 GetPageState(const void *address);
2497 
2515 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
2516 #pragma parameter __D0 PageFaultFatal
2517 #endif
2518 Boolean
2519 PageFaultFatal(void);
2520 
2545 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
2546 #pragma parameter __D0 DebuggerLockMemory(__A0, __A1)
2547 #endif
2548 OSErr
2549 DebuggerLockMemory(void *address, unsigned long count);
2550 
2574 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
2575 #pragma parameter __D0 DebuggerUnlockMemory(__A0, __A1)
2576 #endif
2577 OSErr
2578 DebuggerUnlockMemory(void *address, unsigned long count);
2579 
2590 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
2591 #pragma parameter __D0 EnterSupervisorMode
2592 #endif
2593 StatusRegisterContents
2594 EnterSupervisorMode(void);
2595 
2612 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
2613 #pragma parameter __D0 StripAddress(__D0)
2614 #endif
2615 Ptr
2616 StripAddress(void *theAddress);
2617 #if !TARGET_OS_MAC || !TARGET_CPU_68K
2618 #ifdef __cplusplus
2619 inline DEFINE_API(Ptr) StripAddress(void *theAddress)
2620 {
2621  return (Ptr)theAddress;
2622 }
2623 #else
2624 #define StripAddress(theAddress) ((Ptr)theAddress)
2625 #endif
2626 #endif
2627 
2645 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
2646 #pragma parameter __D0 Translate24To32(__D0)
2647 #endif
2648 Ptr
2649 Translate24To32(void *addr24);
2650 #if !TARGET_OS_MAC || !TARGET_CPU_68K
2651 #ifdef __cplusplus
2652 inline DEFINE_API(Ptr) Translate24To32(void *addr24) { return (Ptr)addr24; }
2653 #else
2654 #define Translate24To32(addr24) ((Ptr)addr24)
2655 #endif
2656 #endif
2657 
2658 #endif /* CALL_NOT_IN_CARBON */
2659 
2690 OSErr
2691 HandToHand(Handle *theHndl);
2692 
2701 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
2702 #pragma parameter __D0 PtrToXHand(__A0, __A1, __D0)
2703 #endif
2704 OSErr
2705 PtrToXHand(const void *srcPtr, Handle dstHndl, long size);
2706 
2715 OSErr
2716 PtrToHand(const void *srcPtr, Handle *dstHndl, long size);
2717 
2726 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
2727 #pragma parameter __D0 HandAndHand(__A0, __A1)
2728 #endif
2729 OSErr
2730 HandAndHand(Handle hand1, Handle hand2);
2731 
2740 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
2741 #pragma parameter __D0 PtrAndHand(__A0, __A1, __D0)
2742 #endif
2743 OSErr
2744 PtrAndHand(const void *ptr1, Handle hand2, long size);
2745 
2746 /* Carbon routines to aid in debugging. */
2747 /* Checks all applicable heaps for validity */
2756 Boolean
2757 CheckAllHeaps(void);
2758 
2759 /* Checks the application heap for validity */
2768 Boolean
2769 IsHeapValid(void);
2770 
2771 /* It is invalid to pass a NULL or an empty Handle to IsHandleValid */
2780 Boolean
2781 IsHandleValid(Handle h);
2782 
2783 /* It is invalid to pass a NULL Pointer to IsPointerValid */
2792 Boolean
2793 IsPointerValid(Ptr p);
2794 
2795 #if OLDROUTINENAMES
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 */
2810 
2811 #if PRAGMA_STRUCT_ALIGN
2812 #pragma options align = reset
2813 #elif PRAGMA_STRUCT_PACKPUSH
2814 #pragma pack(pop)
2815 #elif PRAGMA_STRUCT_PACK
2816 #pragma pack()
2817 #endif
2818 
2819 #ifdef PRAGMA_IMPORT_OFF
2820 #pragma import off
2821 #elif PRAGMA_IMPORT
2822 #pragma import reset
2823 #endif
2824 
2825 #ifdef __cplusplus
2826 }
2827 #endif
2828 
2829 #endif /* __MACMEMORY__ */
2830 * / ter
2831  * \mac_os_x in version 10.0 and
2832  later
2833  * /
2834  Boolean
2835  IsPointerValid(Ptr p);
2836 
2837 #if OLDROUTINENAMES
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 */
2852 
2853 #if PRAGMA_STRUCT_ALIGN
2854 #pragma options align = reset
2855 #elif PRAGMA_STRUCT_PACKPUSH
2856 #pragma pack(pop)
2857 #elif PRAGMA_STRUCT_PACK
2858 #pragma pack()
2859 #endif
2860 
2861 #ifdef PRAGMA_IMPORT_OFF
2862 #pragma import off
2863 #elif PRAGMA_IMPORT
2864 #pragma import reset
2865 #endif
2866 
2867 #ifdef __cplusplus
2868 }
2869 #endif
2870 
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.
long FreeMemSys(void)
THz SystemZone(void)
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)
long MaxBlockSys(void)
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)
void HLockHi(Handle h)
UserFnUPP NewUserFnUPP(UserFnProcPtr userRoutine)
Handle NewEmptyHandleSys(void)
Ptr TopMem(void)
Handle NewHandle(Size byteCount)
long TempFreeMem(void)
void DisposePurgeUPP(PurgeUPP userUPP)
Handle NewHandleClear(Size byteCount)
Handle GZSaveHnd(void)
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)
long FreeMem(void)
Ptr NewPtrClear(Size byteCount)
MoreMasters()
void ReserveMem(Size cbNeeded)
long InvokeGrowZoneUPP(Size cbNeeded, GrowZoneUPP userUPP)
Size MaxMem(Size *grow)
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)
Ptr GetApplLimit(void)
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
x
Definition: ToolUtils.h:163
Definition: MacMemory.h:132
Definition: MacMemory.h:126
Definition: MacMemory.h:147
Definition: MacMemory.h:101