1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
|
{
File: CarbonCore/MacMemory.h
Contains: Memory Manager Interfaces.
Version: CarbonCore-859.2~1
Copyright: © 1985-2008 by Apple Computer, Inc., all rights reserved
Bugs?: For bug reports, consult the following page on
the World Wide Web:
http://www.freepascal.org/bugs.html
}
{ Pascal Translation Updated: Jonas Maebe, <jonas@freepascal.org>, October 2009 }
{
Modified for use with Free Pascal
Version 308
Please report any bugs to <gpc@microbizz.nl>
}
{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
{$mode macpas}
{$packenum 1}
{$macro on}
{$inline on}
{$calling mwpascal}
unit MacMemory;
interface
{$setc UNIVERSAL_INTERFACES_VERSION := $0400}
{$setc GAP_INTERFACES_VERSION := $0308}
{$ifc not defined USE_CFSTR_CONSTANT_MACROS}
{$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
{$endc}
{$ifc defined CPUPOWERPC and defined CPUI386}
{$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
{$endc}
{$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
{$endc}
{$ifc not defined __ppc__ and defined CPUPOWERPC32}
{$setc __ppc__ := 1}
{$elsec}
{$setc __ppc__ := 0}
{$endc}
{$ifc not defined __ppc64__ and defined CPUPOWERPC64}
{$setc __ppc64__ := 1}
{$elsec}
{$setc __ppc64__ := 0}
{$endc}
{$ifc not defined __i386__ and defined CPUI386}
{$setc __i386__ := 1}
{$elsec}
{$setc __i386__ := 0}
{$endc}
{$ifc not defined __x86_64__ and defined CPUX86_64}
{$setc __x86_64__ := 1}
{$elsec}
{$setc __x86_64__ := 0}
{$endc}
{$ifc not defined __arm__ and defined CPUARM}
{$setc __arm__ := 1}
{$elsec}
{$setc __arm__ := 0}
{$endc}
{$ifc defined cpu64}
{$setc __LP64__ := 1}
{$elsec}
{$setc __LP64__ := 0}
{$endc}
{$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
{$error Conflicting definitions for __ppc__ and __i386__}
{$endc}
{$ifc defined __ppc__ and __ppc__}
{$setc TARGET_CPU_PPC := TRUE}
{$setc TARGET_CPU_PPC64 := FALSE}
{$setc TARGET_CPU_X86 := FALSE}
{$setc TARGET_CPU_X86_64 := FALSE}
{$setc TARGET_CPU_ARM := FALSE}
{$setc TARGET_OS_MAC := TRUE}
{$setc TARGET_OS_IPHONE := FALSE}
{$setc TARGET_IPHONE_SIMULATOR := FALSE}
{$elifc defined __ppc64__ and __ppc64__}
{$setc TARGET_CPU_PPC := FALSE}
{$setc TARGET_CPU_PPC64 := TRUE}
{$setc TARGET_CPU_X86 := FALSE}
{$setc TARGET_CPU_X86_64 := FALSE}
{$setc TARGET_CPU_ARM := FALSE}
{$setc TARGET_OS_MAC := TRUE}
{$setc TARGET_OS_IPHONE := FALSE}
{$setc TARGET_IPHONE_SIMULATOR := FALSE}
{$elifc defined __i386__ and __i386__}
{$setc TARGET_CPU_PPC := FALSE}
{$setc TARGET_CPU_PPC64 := FALSE}
{$setc TARGET_CPU_X86 := TRUE}
{$setc TARGET_CPU_X86_64 := FALSE}
{$setc TARGET_CPU_ARM := FALSE}
{$ifc defined(iphonesim)}
{$setc TARGET_OS_MAC := FALSE}
{$setc TARGET_OS_IPHONE := TRUE}
{$setc TARGET_IPHONE_SIMULATOR := TRUE}
{$elsec}
{$setc TARGET_OS_MAC := TRUE}
{$setc TARGET_OS_IPHONE := FALSE}
{$setc TARGET_IPHONE_SIMULATOR := FALSE}
{$endc}
{$elifc defined __x86_64__ and __x86_64__}
{$setc TARGET_CPU_PPC := FALSE}
{$setc TARGET_CPU_PPC64 := FALSE}
{$setc TARGET_CPU_X86 := FALSE}
{$setc TARGET_CPU_X86_64 := TRUE}
{$setc TARGET_CPU_ARM := FALSE}
{$setc TARGET_OS_MAC := TRUE}
{$setc TARGET_OS_IPHONE := FALSE}
{$setc TARGET_IPHONE_SIMULATOR := FALSE}
{$elifc defined __arm__ and __arm__}
{$setc TARGET_CPU_PPC := FALSE}
{$setc TARGET_CPU_PPC64 := FALSE}
{$setc TARGET_CPU_X86 := FALSE}
{$setc TARGET_CPU_X86_64 := FALSE}
{$setc TARGET_CPU_ARM := TRUE}
{ will require compiler define when/if other Apple devices with ARM cpus ship }
{$setc TARGET_OS_MAC := FALSE}
{$setc TARGET_OS_IPHONE := TRUE}
{$setc TARGET_IPHONE_SIMULATOR := FALSE}
{$elsec}
{$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
{$endc}
{$ifc defined __LP64__ and __LP64__ }
{$setc TARGET_CPU_64 := TRUE}
{$elsec}
{$setc TARGET_CPU_64 := FALSE}
{$endc}
{$ifc defined FPC_BIG_ENDIAN}
{$setc TARGET_RT_BIG_ENDIAN := TRUE}
{$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
{$elifc defined FPC_LITTLE_ENDIAN}
{$setc TARGET_RT_BIG_ENDIAN := FALSE}
{$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
{$elsec}
{$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
{$endc}
{$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
{$setc CALL_NOT_IN_CARBON := FALSE}
{$setc OLDROUTINENAMES := FALSE}
{$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
{$setc OPAQUE_UPP_TYPES := TRUE}
{$setc OTCARBONAPPLICATION := TRUE}
{$setc OTKERNEL := FALSE}
{$setc PM_USE_SESSION_APIS := TRUE}
{$setc TARGET_API_MAC_CARBON := TRUE}
{$setc TARGET_API_MAC_OS8 := FALSE}
{$setc TARGET_API_MAC_OSX := TRUE}
{$setc TARGET_CARBON := TRUE}
{$setc TARGET_CPU_68K := FALSE}
{$setc TARGET_CPU_MIPS := FALSE}
{$setc TARGET_CPU_SPARC := FALSE}
{$setc TARGET_OS_UNIX := FALSE}
{$setc TARGET_OS_WIN32 := FALSE}
{$setc TARGET_RT_MAC_68881 := FALSE}
{$setc TARGET_RT_MAC_CFM := FALSE}
{$setc TARGET_RT_MAC_MACHO := TRUE}
{$setc TYPED_FUNCTION_POINTERS := TRUE}
{$setc TYPE_BOOL := FALSE}
{$setc TYPE_EXTENDED := FALSE}
{$setc TYPE_LONGLONG := TRUE}
uses MacTypes;
{$endc} {not MACOSALLINCLUDE}
{$ifc TARGET_OS_MAC}
{$ALIGN MAC68K}
const
maxSize = $7FFFFFF0; {the largest block possible}
{
If you define a macro named __MAC_OS_X_MEMORY_MANAGER_CLEAN__ with a non-zero value, then
some Memory Manager APIs will become inlined, minimal implementations. See the comments
below for more information about this.
}
{$setc __MAC_OS_X_MEMORY_MANAGER_CLEAN__ := 0}
{$ifc not __MAC_OS_X_MEMORY_MANAGER_CLEAN__}
const
defaultPhysicalEntryCount = 8;
const
{ values returned from the GetPageState function }
kPageInMemory = 0;
kPageOnDisk = 1;
kNotPaged = 2;
const
{ masks for Zone->heapType field }
k32BitHeap = 1; { valid in all Memory Managers }
kNewStyleHeap = 2; { true if new Heap Manager is present }
kNewDebugHeap = 4; { true if new Heap Manager is running in debug mode on this heap }
{$endc} {not __MAC_OS_X_MEMORY_MANAGER_CLEAN__}
{ bits for use with HGetState/HSetState}
const
kHandleIsResourceBit = 5;
kHandlePurgeableBit = 6;
kHandleLockedBit = 7;
{ masks for use with HGetState/HSetState}
const
kHandleIsResourceMask = $20;
kHandlePurgeableMask = $40;
kHandleLockedMask = $80;
{$ifc not TARGET_CPU_64}
type
GrowZoneProcPtr = function( cbNeeded: Size ): SIGNEDLONG;
PurgeProcPtr = procedure( blockToPurge: Handle );
UserFnProcPtr = procedure( parameter: UnivPtr );
GrowZoneUPP = GrowZoneProcPtr;
PurgeUPP = PurgeProcPtr;
UserFnUPP = UserFnProcPtr;
ZonePtr = ^Zone;
Zone = record
bkLim: Ptr;
purgePtr: Ptr;
hFstFree: Ptr;
zcbFree: SIGNEDLONG;
gzProc: GrowZoneUPP;
moreMast: SInt16;
flags: SInt16;
cntRel: SInt16;
maxRel: SInt16;
cntNRel: SInt16;
heapType: SInt8; { previously "maxNRel", now holds flags (e.g. k32BitHeap)}
unused: SInt8;
cntEmpty: SInt16;
cntHandles: SInt16;
minCBFree: SIGNEDLONG;
purgeProc: PurgeUPP;
sparePtr: Ptr;
allocPtr: Ptr;
heapData: SInt16;
end;
type
THz = ^Zone;
THzPtr = ^THz;
{$ifc not __MAC_OS_X_MEMORY_MANAGER_CLEAN__}
type
MemoryBlockPtr = ^MemoryBlock;
MemoryBlock = record
address: UnivPtr;
count: UNSIGNEDLONG;
end;
type
LogicalToPhysicalTablePtr = ^LogicalToPhysicalTable;
LogicalToPhysicalTable = record
logical: MemoryBlock;
physical: array [0..7] of MemoryBlock;
end;
PageState = SInt16;
StatusRegisterContents = SInt16;
const
kVolumeVirtualMemoryInfoVersion1 = 1; { first version of VolumeVirtualMemoryInfo}
type
VolumeVirtualMemoryInfo = record
version: PBVersion; { Input: Version of the VolumeVirtualMemoryInfo structure}
volumeRefNum: SInt16; { Input: volume reference number}
inUse: Boolean; { output: true if volume is currently used for file mapping}
_fill: UInt8;
vmOptions: UInt32; { output: tells what volume can support (same as DriverGestaltVMOptionsResponse vmOptions bits in DriverGestalt)}
{ end of kVolumeVirtualMemoryInfoVersion1 structure}
end;
VolumeVirtualMemoryInfoPtr = ^VolumeVirtualMemoryInfo;
{$endc} {not __MAC_OS_X_MEMORY_MANAGER_CLEAN__}
{
* NewGrowZoneUPP()
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: available as macro/inline
}
function NewGrowZoneUPP( userRoutine: GrowZoneProcPtr ): GrowZoneUPP; external name '_NewGrowZoneUPP';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
{
* NewPurgeUPP()
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: available as macro/inline
}
function NewPurgeUPP( userRoutine: PurgeProcPtr ): PurgeUPP; external name '_NewPurgeUPP';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
{
* NewUserFnUPP()
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: available as macro/inline
}
function NewUserFnUPP( userRoutine: UserFnProcPtr ): UserFnUPP; external name '_NewUserFnUPP';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
{
* DisposeGrowZoneUPP()
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: available as macro/inline
}
procedure DisposeGrowZoneUPP( userUPP: GrowZoneUPP ); external name '_DisposeGrowZoneUPP';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
{
* DisposePurgeUPP()
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: available as macro/inline
}
procedure DisposePurgeUPP( userUPP: PurgeUPP ); external name '_DisposePurgeUPP';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
{
* DisposeUserFnUPP()
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: available as macro/inline
}
procedure DisposeUserFnUPP( userUPP: UserFnUPP ); external name '_DisposeUserFnUPP';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
{
* InvokeGrowZoneUPP()
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: available as macro/inline
}
function InvokeGrowZoneUPP( cbNeeded: Size; userUPP: GrowZoneUPP ): SIGNEDLONG; external name '_InvokeGrowZoneUPP';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
{
* InvokePurgeUPP()
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: available as macro/inline
}
procedure InvokePurgeUPP( blockToPurge: Handle; userUPP: PurgeUPP ); external name '_InvokePurgeUPP';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
{
* InvokeUserFnUPP()
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: available as macro/inline
}
procedure InvokeUserFnUPP( parameter: UnivPtr; userUPP: UserFnUPP ); external name '_InvokeUserFnUPP';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
{$endc} {not TARGET_CPU_64}
{
* MemError()
*
* Summary:
* Determines if an applicationÕs last direct call to a Memory
* Manager function executed successfully.
*
* Discussion:
* MemError() yields the result code produced by the last Memory
* Manager function your application called directly, and resets
* MemError() to return noErr in the future. MemError() is useful
* during application debugging. You might also use MemError as one
* part of a memory-management scheme to identify instances in which
* the Memory Manager rejects overly large memory requests by
* returning the error code memFullErr.
*
* To view the result codes that MemError() can produce, see "Memory
* Manager Result Codes".
*
* Do not rely on MemError() as the only component of a
* memory-management scheme. For example, suppose you call NewHandle
* or NewPtr and receive the result code noErr, indicating that the
* Memory Manager was able to allocate sufficient memory. In this
* case, you have no guarantee that the allocation did not deplete
* your applicationÕs memory reserves to levels so low that simple
* operations might cause your application to crash. Instead of
* relying on MemError(), check before making a memory request that
* there is enough memory both to fulfill the request and to support
* essential operations.
*
* On Mac OS X 10.3 and later, the value of MemError() is kept for
* each thread; prior to Mac OS X 10.3. MemError() is global to the
* application. Because of this, and other problems, the Memory
* Manager APIs are not thread safe before Mac OS X 10.3.
*
* Mac OS X threading:
* Thread safe since version 10.3
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function MemError: OSErr; external name '_MemError';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* LMGetMemErr()
*
* Summary:
* Returns the result of the last Memory Manager function, without
* clearing the value like MemError() does.
*
* Discussion:
* LMGetMemErr yields the result code produced by the last Memory
* Manager function your application called directly. Unlike
* MemError(), this function does not reset the stored value, so
* subsequent calls to LMGetMemErr() will still return this value
* until the next Memory Manager routine is called or until
* MemError() is called to reset the value. LMGetMemErr is useful
* during application debugging. You might also use this value as
* one part of a memory-management scheme to identify instances in
* which the Memory Manager rejects overly large memory requests by
* returning the error code memFullErr.
*
* To view the result codes that MemError() can produce, see "Memory
* Manager Result Codes".
*
* Do not rely on MemError() as the only component of a
* memory-management scheme. For example, suppose you call NewHandle
* or NewPtr and receive the result code noErr, indicating that the
* Memory Manager was able to allocate sufficient memory. In this
* case, you have no guarantee that the allocation did not deplete
* your applicationÕs memory reserves to levels so low that simple
* operations might cause your application to crash. Instead of
* relying on MemError(), check before making a memory request that
* there is enough memory both to fulfill the request and to support
* essential operations.
*
* On Mac OS X 10.3 and later, the value of MemError() is kept for
* each thread; prior to Mac OS X 10.3 there was one global value of
* MemError() which all threads shared. Because of this, and other
* problems, the Memory Manager APIs are not thread safe before Mac
* OS X 10.3.
*
* Mac OS X threading:
* Not thread safe
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function LMGetMemErr: SInt16; external name '_LMGetMemErr';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* LMSetMemErr()
*
* Summary:
* Set the value which will be returned by MemError()
*
* Discussion:
* User code shouldn't need to call this function, which is used to
* set the value which the next call to MemError() will return.
*
* Mac OS X threading:
* Not thread safe
*
* Parameters:
*
* value:
* the value which the next MemError() function call should return
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
procedure LMSetMemErr( value: SInt16 ); external name '_LMSetMemErr';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* NewHandle()
*
* Summary:
* Allocate a relocatable memory block of a specified size.
*
* Discussion:
* The NewHandle function attempts to allocate a new relocatable
* block in the current heap zone with a logical size of logicalSize
* bytes and then return a handle to the block. The new block is
* unlocked and unpurgeable. If NewHandle cannot allocate a block of
* the requested size, it returns NULL. The memory block returned
* likely will contain garbage, and will be unlocked and
* non-purgeable.
*
* WARNING
*
* Do not try to manufacture your own handles without this function
* by simply assigning the address of a variable of type Ptr to a
* variable of type Handle. The resulting "fake handle" would not
* reference a relocatable block and could cause a system crash.
* If this function returns NIL, the error result can be determined
* by calling the function MemError().
*
* Mac OS X threading:
* Thread safe since version 10.3
*
* Parameters:
*
* byteCount:
* the size of the relocatable memory block to allocate. If this
* value is < 0, NIL will be returned. If this value is 0, a
* handle to 0 byte block will be returned.
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function NewHandle( byteCount: Size ): Handle; external name '_NewHandle';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* NewHandleClear()
*
* Summary:
* Allocate a relocatable memory block of a specified size.
*
* Discussion:
* The NewHandle function attempts to allocate a new relocatable
* block in the current heap zone with a logical size of logicalSize
* bytes and then return a handle to the block. The new block is
* unlocked and unpurgeable. If NewHandle cannot allocate a block of
* the requested size, it returns NULL. The memory block returned
* will be zeroed, and will be unlocked and non-purgeable.
*
* WARNING
*
* Do not try to manufacture your own handles without this function
* by simply assigning the address of a variable of type Ptr to a
* variable of type Handle. The resulting "fake handle" would not
* reference a relocatable block and could cause a system crash.
* If this function returns NIL, the error result can be determined
* by calling the function MemError().
*
* Mac OS X threading:
* Thread safe since version 10.3
*
* Parameters:
*
* byteCount:
* the size of the relocatable memory block to allocate. If this
* value is < 0, NIL will be returned. If this value is 0, a
* handle to 0 byte block will be returned.
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function NewHandleClear( byteCount: Size ): Handle; external name '_NewHandleClear';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* RecoverHandle()
*
* Summary:
* Returns a handle to a relocatable block pointed to by a specified
* pointer.
*
* Discussion:
* The Memory Manager does not allow you to change relocatable
* blocks into nonrelocatable blocks, or vice-versa. However, if you
* no longer have access to a handle but still have access to its
* master pointer p, you can use the RecoverHandle function to
* recreate a handle to the relocatable block referenced by
* p.
*
* Call the function MemError() to get the result code. See "Memory
* Manager Result Codes".
*
* Mac OS X threading:
* Thread safe since version 10.3
*
* Parameters:
*
* p:
* the master pointer to a relocatable block.
*
* Result:
* A handle to a relocatable block point to by p. If p does not
* point to a valid block, this function returns NULL.
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function RecoverHandle( p: Ptr ): Handle; external name '_RecoverHandle';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* NewPtr()
*
* Summary:
* Allocates a nonrelocatable block of memory of a specified size.
*
* Discussion:
* The NewPtr function attempts to reserve space for the new block.
* If it is able to reserve the requested amount of space, NewPtr
* allocates the nonrelocatable block. Otherwise, NewPtr returns
* NULL and generates a memFullErr error. On Mac OS X, NewPtr will
* never fail because it is unable to allocate the pointer. Certain
* old versions of Mac OS X return a NULL pointer when asked to
* allocate a pointer of size 0.
* Call the function MemError to get the result code. See "Memory
* Manager Result Codes".
*
* Mac OS X threading:
* Thread safe since version 10.3
*
* Parameters:
*
* byteCount:
* The requested size (in bytes) of the nonrelocatable block. If
* you pass a value of zero, this function returns a valid zero
* length pointer.
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function NewPtr( byteCount: Size ): Ptr; external name '_NewPtr';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* NewPtrClear()
*
* Summary:
* Allocates a nonrelocatable block of memory of a specified size
* with all its bytes set to 0.
*
* Discussion:
* The NewPtr function attempts to reserve space for the new block.
* If it is able to reserve the requested amount of space, NewPtr
* allocates the nonrelocatable block. Otherwise, NewPtr returns
* NULL and generates a memFullErr error. On Mac OS X, NewPtr will
* never fail because it is unable to allocate the pointer. Certain
* old versions of Mac OS X return a NULL pointer when asked to
* allocate a pointer of size 0.
* Call the function MemError to get the result code. See "Memory
* Manager Result Codes".
*
* Mac OS X threading:
* Thread safe since version 10.3
*
* Parameters:
*
* byteCount:
* The requested size (in bytes) of the nonrelocatable block. If
* you pass a value of zero, this function returns a valid zero
* length pointer.
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function NewPtrClear( byteCount: Size ): Ptr; external name '_NewPtrClear';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{$ifc not TARGET_CPU_64}
{
* MaxBlock() *** DEPRECATED ***
*
* Summary:
* Return the size of the largest block you could allocate in the
* current heap zone after compaction.
*
* Discussion:
* On Mac OS X, this function always returns a large value, because
* virtual memory is always available to fulfill any request for
* memory. This function is deprecated on Mac OS X and later. You
* can assume that any reasonable memory allocation will succeed.
*
* Mac OS X threading:
* Not thread safe
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function MaxBlock: SIGNEDLONG; external name '_MaxBlock';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
{
* StackSpace() *** DEPRECATED ***
*
* Summary:
* Returns the amount of space unused on the current thread's stack.
*
* Mac OS X threading:
* Not thread safe
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function StackSpace: SIGNEDLONG; external name '_StackSpace';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
{$endc} {not TARGET_CPU_64}
{
* NewEmptyHandle()
*
* Summary:
* Initializes a new handle without allocating any memory for it to
* control.
*
* Discussion:
* When you want to allocate memory for the empty handle, use the
* ReallocateHandle function.
* Call the function MemError to get the result code. See "Memory
* Manager Result Codes".
*
* Mac OS X threading:
* Thread safe since version 10.3
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function NewEmptyHandle: Handle; external name '_NewEmptyHandle';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* HLock()
*
* Summary:
* Lock a relocatable block so that it does not move in the heap
*
* Discussion:
* The HLock procedure locks the relocatable block to which h is a
* handle, preventing it from being moved within its heap zone. If
* the block is already locked,HLock does nothing.
*
* On Mac OS X, the behaviour of the Memory Manager and of heaps in
* general is different than on Mac OS 9.x and earlier. In
* particular, the heap on Mac OS X is never purged or compacted.
* Therefore, an unlocked handle will never be relocated except as a
* result of a direct action by something calling SetHandleSize() or
* by using a function like PtrAndHand() which implicitly resizes
* the handle to append data to it. Because of this, most locking
* and unlocking of handles is unnecessary on Mac OS X, and the use
* of HLock() and other functions is being deprecated. If you
* define a macro named __MAC_OS_X_MEMORY_MANAGER_CLEAN__ to 1 in
* your sources before you include MacMemory.h, then HLock() and
* several other functions will become empty operations, removing
* the overhead of a function call.
*
* However, some applications are relying on the behavior that
* resizing a locked handle produces an error, or tracking the state
* of the locked bit for a give handle via the HGetState() function.
* Applications which rely on this can not use
* __MAC_OS_X_MEMORY_MANAGER_CLEAN__.
*
* Mac OS X threading:
* Thread safe since version 10.3
*
* Parameters:
*
* h:
* the handle to lock. If h is == NULL, then HLock() sets
* MemError() to noErr.
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
procedure HLock( h: Handle ); external name '_HLock';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* HLockHi()
*
* Summary:
* Lock a relocatable handle.
*
* Discussion:
* The HLockHi() function locks a handle in memory. On versions of
* Mac OS before Mac OS X, it would first attempt to move the handle
* as high in memory as feasible. However, on Mac OS X and later,
* there is no advantage to having handles high in memory, and so
* this function never moves a handle before locking it.
* See the discussion about handle locking above the function
* HLock().
*
* Mac OS X threading:
* Not thread safe
*
* Parameters:
*
* h:
* the handle to lock. If h is == NULL, then HLockHi() sets
* MemError() to noErr.
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
procedure HLockHi( h: Handle ); external name '_HLockHi';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* HUnlock()
*
* Summary:
* Unlock a relocatable block so that it does not move in the heap
*
* Discussion:
* The HUnlock procedure unlocks the relocatable block to which h is
* a handle, allowing it from being moved within its heap zone. If
* the block is already unlocked, HUnlock does nothing.
*
* See the discussion about handles and locking on Mac OS X above
* the HLock() function.
*
* Mac OS X threading:
* Thread safe since version 10.3
*
* Parameters:
*
* h:
* the handle to unlock. If h is == NULL, then HUnlock() sets
* MemError() to noErr.
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
procedure HUnlock( h: Handle ); external name '_HUnlock';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{$ifc not TARGET_CPU_64}
{
* HPurge() *** DEPRECATED ***
*
* Summary:
* Mark a relocatable block so that it does can be purged if a
* memory request cannot be fulfilled after compaction of the heap
*
* Discussion:
* The HPurge procedure makes the relocatable block to which h is a
* handle purgeable. If the block is already purgeable, HPurge does
* nothing.
*
* On Mac OS X, heaps are never purged. Therefore, the use of
* HPurge() and its associated functios is deprecated. If you define
* a macro __MAC_OS_X_MEMORY_MANAGER_CLEAN__ in your sources before
* you include MacMemory.h, then any calls to HPurge() in your
* program will essentially be removed.
*
* However, some applications may set the handle as purgeable, and
* then later check the purgeBit for the handle via HGetState(). If
* your application depends on the purge bit being set for handles,
* you will not be able to take advantage of this macro.
*
* Mac OS X threading:
* Thread safe since version 10.3
*
* Parameters:
*
* h:
* the handle to mark as purgeable. If h is == NULL, then
* HPurge() just sets MemError() to noErr.
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.4
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
procedure HPurge( h: Handle ); external name '_HPurge';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
{
* HNoPurge() *** DEPRECATED ***
*
* Summary:
* Mark a relocatable block so that it can not be purged.
*
* Discussion:
* The HNoPurge procedure makes the relocatable block to which h is
* a handle unpurgeable. See the discussion about purgable handles
* above the HPurge() function.
*
* Mac OS X threading:
* Thread safe since version 10.3
*
* Parameters:
*
* h:
* the handle to mark as nonpurgeable. If h is == NULL, then
* HPurge() just sets MemError() to noErr.
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.4
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
procedure HNoPurge( h: Handle ); external name '_HNoPurge';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
{$endc} {not TARGET_CPU_64}
{
* TempNewHandle()
*
* Summary:
* Allocate a relocatable memory block of a specified size.
*
* Discussion:
* The TempNewHandle function attempts to allocate a new relocatable
* block in the current heap zone with a logical size of logicalSize
* bytes and then return a handle to the block. The new block is
* unlocked and unpurgeable. If NewHandle cannot allocate a block of
* the requested size, it returns NULL. The memory block returned
* likely will contain garbage.
*
* WARNING
*
* Do not try to manufacture your own handles without this function
* by simply assigning the address of a variable of type Ptr to a
* variable of type Handle. The resulting "fake handle" would not
* reference a relocatable block and could cause a system crash.
* If this function returns NIL, the error result can be determined
* by calling the function MemError().
*
* On Mac OS X, there is no temporary memory heap, and thus no
* difference between the handles returned by TempNewHandle() and
* those returned by NewHandle(). The only difference between the
* two is that TempNewHandle() also returns the error result of the
* call in resultCode.
*
* Mac OS X threading:
* Not thread safe
*
* Parameters:
*
* logicalSize:
* the size of the relocatable memory block to allocate. If this
* value is < 0, NIL will be returned. If this value is 0, a
* handle to 0 byte block will be returned.
*
* resultCode:
* On exit, this will be set to the result of the operation.
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function TempNewHandle( logicalSize: Size; var resultCode: OSErr ): Handle; external name '_TempNewHandle';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{$ifc not TARGET_CPU_64}
{
* TempMaxMem() *** DEPRECATED ***
*
* Summary:
* Return the maximum amount of temporary memory available
*
* Discussion:
* On Mac OS X, this function always returns a large value, because
* virtual memory is always available to fulfill any request for
* memory. This function is deprecated on Mac OS X and later. You
* can assume that any reasonable memory allocation will succeed.
*
* Mac OS X threading:
* Not thread safe
*
* Parameters:
*
* grow:
* If != NULL, then this is filled in with the the value 0.
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.4
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function TempMaxMem( var grow: Size ): Size; external name '_TempMaxMem';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
{
* TempFreeMem() *** DEPRECATED ***
*
* Summary:
* Return the maximum amount of free memory in the temporary heap.
*
* Discussion:
* On Mac OS X, there is no separate temporary memory heap. This
* function always returns a large value, because virtual memory is
* always available to fulfill any request for memory. This
* function is deprecated on Mac OS X and later. You can assume
* that any reasonable memory allocation will succeed.
*
* Mac OS X threading:
* Not thread safe
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.4
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function TempFreeMem: SIGNEDLONG; external name '_TempFreeMem';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
{
* CompactMem() *** DEPRECATED ***
*
* Summary:
* Compact the heap by purging and moving blocks such that at least
* cbNeeded bytes are available, if possible.
*
* Discussion:
* On Mac OS X and later, blocks are never purged and memory heaps
* will grow as necessary, so compaction is never necessary nor
* performed.
*
* Mac OS X threading:
* Not thread safe
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.4
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function CompactMem( cbNeeded: Size ): Size; external name '_CompactMem';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
{
* PurgeMem() *** DEPRECATED ***
*
* Summary:
* Purge blocks from the heap until cbNeeded bytes are available, if
* possible.
*
* Discussion:
* On Mac OS X and later, blocks are never purged and memory heaps
* will grow as necessary, so purging of a heap is never necessary
* nor performed.
*
* Mac OS X threading:
* Not thread safe
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.4
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
procedure PurgeMem( cbNeeded: Size ); external name '_PurgeMem';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
{
* FreeMem() *** DEPRECATED ***
*
* Summary:
* Return the maximum amount of free memory in the temporary heap.
*
* Discussion:
* On Mac OS X, this function always returns a large value, because
* virtual memory is always available to fulfill any request for
* memory. This function is deprecated on Mac OS X and later. You
* can assume that any reasonable memory allocation will succeed.
*
* Mac OS X threading:
* Not thread safe
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
*
* Note:
* FreeMem has been renamed MacFreeMem, to resolve a naming conflict with
* FreeMem in the Turbo Pascal/Delphi/FreePascal runtime library
}
function MacFreeMem: SInt32; external name '_FreeMem';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
{
* MaxMem() *** DEPRECATED ***
*
* Summary:
* Return the maximum amount of free memory available
*
* Discussion:
* On Mac OS X, this function always returns a large value, because
* virtual memory is always available to fulfill any request for
* memory. This function is deprecated on Mac OS X and later. You
* can assume that any reasonable memory allocation will succeed.
*
* Mac OS X threading:
* Not thread safe
*
* Parameters:
*
* grow:
* If != NULL, then this is filled in with the the value 0.
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function MaxMem( var grow: Size ): Size; external name '_MaxMem';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
{
* SetGrowZone() *** DEPRECATED ***
*
* Summary:
* Set a function which is called when a heap is grown
*
* Discussion:
* On Mac OS X and later, heaps never grow, and so the function set
* by SetGrowZone() is never called.
*
* Mac OS X threading:
* Not thread safe
*
* Parameters:
*
* growZone:
* a upp for a function to call when a heap needs to be grown
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.4
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
procedure SetGrowZone( growZone: GrowZoneUPP ); external name '_SetGrowZone';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
{
* GetGrowZone() *** DEPRECATED ***
*
* Summary:
* Get the function which is called when a heap is grown
*
* Discussion:
* On Mac OS X and later, heaps never grow, and so this function (
* set by SetGrowZone() ) is never called.
*
* Mac OS X threading:
* Not thread safe
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.4
* CarbonLib: in CarbonLib 1.1 and later
* Non-Carbon CFM: not available
}
function GetGrowZone: GrowZoneUPP; external name '_GetGrowZone';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
{
* MoveHHi() *** DEPRECATED ***
*
* Summary:
* Move a handle as high in memory as possible
*
* Discussion:
* On versions of Mac OS before Mac OS X, MoveHHi() would move the
* handle as high in memory as feasible. However, on Mac OS X and
* later, there is no advantage to having handles high in memory,
* and so this function never moves a handle before locking it.
* See the discussion about handle locking above the function
* HLock().
*
* Mac OS X threading:
* Not thread safe
*
* Parameters:
*
* h:
* the handle to move
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.4
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
procedure MoveHHi( h: Handle ); external name '_MoveHHi';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
{$endc} {not TARGET_CPU_64}
{
* DisposePtr()
*
* Summary:
* Release memory occupied by a nonrelocatable block
*
* Discussion:
* When you no longer need a nonrelocatable block, call the
* DisposePtr function to free it for other uses.
* Call the function MemError to get the result code. See "Memory
* Manager Result Codes".
* After a call to DisposePtr, all pointers to the released block
* become invalid and should not be used again. Any subsequent use
* of a pointer to the released block might cause a system error.
* You can pass the value NULL as the pointer to dispose.
*
* Mac OS X threading:
* Thread safe since version 10.3
*
* Parameters:
*
* p:
* A pointer to the nonrelocatable block you want to dispose of
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
procedure DisposePtr( p: Ptr ); external name '_DisposePtr';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* GetPtrSize()
*
* Summary:
* Returns the logical size of the nonrelocatable block
* corresponding to a pointer.
*
* Discussion:
* This function returns the number of bytes used for the given
* pointer. Call the function MemError to get the result code. See
* "Memory Manager Result Codes".
*
* Mac OS X threading:
* Thread safe since version 10.3
*
* Parameters:
*
* p:
* a pointer to a nonrelocatable block.
*
* Result:
* The logical size, in bytes, of the nonrelocatable block pointed
* to by p. In case of error, the function returns 0.
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function GetPtrSize( p: Ptr ): Size; external name '_GetPtrSize';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* SetPtrSize()
*
* Mac OS X threading:
* Thread safe since version 10.3
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
procedure SetPtrSize( p: Ptr; newSize: Size ); external name '_SetPtrSize';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* DisposeHandle()
*
* Summary:
* Releases memory occupied by a relocatable block.
*
* Discussion:
* The DisposeHandle function releases the memory occupied by the
* relocatable block whose handle is h. It also frees the handleÕs
* master pointer for other uses.
* Do not use DisposeHandle to dispose of a handle obtained from the
* Resource Manager (for example, by a previous call to
* GetResource), useReleaseResource instead. If, however, you have
* called DetachResource on a resource handle, you should dispose of
* the storage by callingDisposeHandle.
* Call the function MemError to get the result code. See "Memory
* Manager Result Codes".
* After a call to DisposeHandle, all handles to the released block
* become invalid and should not be used again. Any subsequent calls
* to DisposeHandleusing an invalid handle might damage the master
* pointer list. You can pass the value NULL as the handle to
* dispose.
*
* Mac OS X threading:
* Thread safe since version 10.3
*
* Parameters:
*
* h:
* A handle to a relocatable block.
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
procedure DisposeHandle( h: Handle ); external name '_DisposeHandle';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* SetHandleSize()
*
* Summary:
* Changes the logical size of the relocatable block corresponding
* to the specified handle.
*
* Discussion:
* Change the logical size of the relocatable block corresponding to
* the specified handle. SetHandleSize might need to move the
* relocatable block to obtain enough space for the resized block.
* Thus, for best results you should unlock a block before resizing
* it.
*
* An attempt to increase the size of a locked block might fail,
* because of blocks above and below it that are either
* nonrelocatable or locked. You should be prepared for this
* possibility.
*
* Instead of using the SetHandleSize function to set the size of a
* handle to 0, you can use the EmptyHandle function.
*
* Mac OS X threading:
* Thread safe since version 10.3
*
* Parameters:
*
* h:
* a handle to a relocatable block.
*
* newSize:
* the desired new logical size, in bytes, of the relocatable
* block.
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
procedure SetHandleSize( h: Handle; newSize: Size ); external name '_SetHandleSize';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* GetHandleSize()
*
* Summary:
* Returns the logical size of the relocatable block corresponding
* to a handle.
*
* Discussion:
* Returns the logical size of the relocatable block corresponding
* to a handle. Call the function MemError to get the result code.
* See "Memory Manager Result Codes".
*
* Mac OS X threading:
* Thread safe since version 10.3
*
* Parameters:
*
* h:
* a handle to a relocatable block.
*
* Result:
* The logical size, in bytes, of the relocatable block whose handle
* is h. In case of error, the function return 0.
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function GetHandleSize( h: Handle ): Size; external name '_GetHandleSize';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* ReallocateHandle()
*
* Summary:
* Allocates a new relocatable block of a specified size and sets a
* handleÕs master pointer to point to the new block.
*
* Discussion:
* Usually you use ReallocateHandle to reallocate space for a block
* that you have emptied. If the handle references an existing
* block, ReallocateHandle releases that block before creating a new
* one.
*
* To reallocate space for a resource that has been purged, you
* should call LoadResource, not ReallocateHandle. To resize
* relocatable blocks, you should call the SetHandleSize
* function.
*
* Call the function MemError to get the result code. See "Memory
* Manager Result Codes".
*
* Mac OS X threading:
* Thread safe since version 10.3
*
* Parameters:
*
* h:
* A handle to a relocatable block.
*
* byteCount:
* the desired new logical size (in bytes) of the relocatable
* block. The new block is unlocked and unpurgeable.
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
procedure ReallocateHandle( h: Handle; byteCount: Size ); external name '_ReallocateHandle';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* EmptyHandle()
*
* Summary:
* Purges a relocatable block and sets the corresponding handleÕs
* master pointer to NULL.
*
* Discussion:
* The EmptyHandle function purges the relocatable block whose
* handle is h and sets the handleÕs master pointer to NULL. The
* EmptyHandle function allows you to free memory taken by a
* relocatable block without freeing the relocatable blockÕs master
* pointer for other uses. The block whose handle is h must be
* unlocked but need not be purgeable.
*
* Note that if there are multiple handles to the relocatable block,
* then calling the EmptyHandle function empties them all, because
* all of the handles share a common master pointer. When you later
* use ReallocateHandle to reallocate space for the block, the
* master pointer is updated, and all of the handles reference the
* new block correctly.
*
* To free the memory taken up by a relocatable block and release
* the blockÕs master pointer for other uses, use the DisposeHandle
* function.
*
* Call the function MemError to get the result code. See "Memory
* Manager Result Codes".
*
* Mac OS X threading:
* Thread safe since version 10.3
*
* Parameters:
*
* h:
* a handle to a relocatable block.
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
procedure EmptyHandle( h: Handle ); external name '_EmptyHandle';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* HSetRBit()
*
* Summary:
* Set the "R" bit for the handle state.
*
* Mac OS X threading:
* Thread safe since version 10.3
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
procedure HSetRBit( h: Handle ); external name '_HSetRBit';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* HClrRBit()
*
* Summary:
* Clear the "R" bit for the handle state.
*
* Mac OS X threading:
* Thread safe since version 10.3
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
procedure HClrRBit( h: Handle ); external name '_HClrRBit';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* HGetState()
*
* Summary:
* Get the current state of the handle's locked, purgeable, and R
* bits
*
* Discussion:
* The HGetState function returns a signed byte (char) containing
* the flags of the master pointer for the given handle. You can
* save this byte, change the state of any of the flags using the
* functions described in this section, and then restore their
* original states by passing the byte to the HSetState
* function.
*
* You can use bit-manipulation functions on the returned signed
* byte to determine the value of a given attribute.
* Currently the following bits are used:
* kHandleIsResourceBit - if set, handle is a resource
* kHandlePurgeableBit - if set, handle is purgeable
* kHandleLockedBit - if set, handle is locked
* On Mac OS X and later, heaps are never purged, so the purgeable
* bit is used but its setting is essentially ignored. Also, since
* heaps are never compacted, and therefore the only time a handle
* moves is when that handle is resized, the danger of using
* defererenced handles is lower and so handles likely do not need
* to be locked as often. Because of this, the state for a handle is
* less useful, and HGetState() and other functions is being
* deprecated. If you define a macro named
* __MAC_OS_X_MEMORY_MANAGER_CLEAN__ in your sources before you
* include MacMemory.h, then HGetState() and several other functions
* will become empty operations, removing the overhead of a function
* call.
*
* However, some applications may depend on the state bits of a
* handle being correct or changing as functions like HLock(), etc.,
* are called. Applications which rely on this can not use
* __MAC_OS_X_MEMORY_MANAGER_CLEAN__.
*
* Mac OS X threading:
* Thread safe since version 10.3
*
* Parameters:
*
* h:
* the handle to get the state for
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function HGetState( h: Handle ): SInt8; external name '_HGetState';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* HSetState()
*
* Summary:
* Set the current state of the handle's locked, purgeable, and R
* bits
*
* Discussion:
* See the discussion about handle state and Mac OS X above the
* function HGetState().
*
* Mac OS X threading:
* Thread safe since version 10.3
*
* Parameters:
*
* h:
* the handle to set the state for
*
* flags:
* the flags to set for the handle
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
procedure HSetState( h: Handle; flags: SInt8 ); external name '_HSetState';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{****************************************************************************
Beginning in Mac OS X Tiger, BlockMove, BlockMoveData, BlockMoveUncached,
BlockMoveDataUncached, BlockZero, and BlockZeroUncached are inlined to a
direct call to the posix memmove or bzero functions; this allows the
compiler to optimize in some cases.
However, CarbonCore.framework still exports functions with these names,
both so old code which linked them there will run and to support
compilers which don't support inline function definitions.
To use the exported version of BlockMove, #define NO_BLOCKMOVE_INLINE
in your source code ( or prefix header file ) before including any headers
which would include MacMemory.h.
****************************************************************************}
{$ifc not TARGET_CPU_64}
{
* BlockMove()
*
* Availability:
* Non-Carbon CFM: in DriverServicesLib 1.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
}
procedure BlockMove( srcPtr: {const} UnivPtr; destPtr: UnivPtr; byteCount: Size ); external name '_BlockMove';
{
* BlockMoveData()
*
* Availability:
* Non-Carbon CFM: in DriverServicesLib 1.0 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
}
procedure BlockMoveData( srcPtr: {const} UnivPtr; destPtr: UnivPtr; byteCount: Size ); external name '_BlockMoveData';
{
* BlockMoveUncached()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 8.5 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
}
procedure BlockMoveUncached( srcPtr: {const} UnivPtr; destPtr: UnivPtr; byteCount: Size ); external name '_BlockMoveUncached';
{
* BlockMoveDataUncached()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 8.5 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
}
procedure BlockMoveDataUncached( srcPtr: {const} UnivPtr; destPtr: UnivPtr; byteCount: Size ); external name '_BlockMoveDataUncached';
{
* BlockZero()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 8.5 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
}
procedure BlockZero( destPtr: UnivPtr; byteCount: Size ); external name '_BlockZero';
{
* BlockZeroUncached()
*
* Availability:
* Non-Carbon CFM: in InterfaceLib 8.5 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 and later
}
procedure BlockZeroUncached( destPtr: UnivPtr; byteCount: Size ); external name '_BlockZeroUncached';
{$endc} {not TARGET_CPU_64}
{
* HandToHand()
*
* Summary:
* Copies all of the data from one relocatable block to a new
* relocatable block.
*
* Discussion:
* The HandToHand function attempts to copy the information in the
* relocatable block to which theHndl is a handle; if successful,
* HandToHand sets theHndlto a handle pointing to the new
* relocatable block.
*
* If successful in creating a new relocatable block, the HandToHand
* function does not duplicate the properties of the original block.
* The new block is unlocked, unpurgeable, and not a resource. Call
* HLock or HPurge to adjust the properties of the new
* block.
*
* To copy only part of a relocatable block into a new relocatable
* block, use the PtrToHand function. Before calling PtrToHand, lock
* and dereference the handle pointing to the relocatable block you
* want to copy.
*
* Because HandToHand replaces its parameter with the new handle,
* you should retain the original parameter value somewhere else,
* otherwise you will not be able to access it.
*
* Mac OS X threading:
* Thread safe since version 10.3
*
* Parameters:
*
* theHndl:
* a handle to the relocatable block whose data HandToHand will
* copy. On return, theHndl contains a handle to a new
* relocatable block whose data duplicates the original.
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function HandToHand( var theHndl: Handle ): OSErr; external name '_HandToHand';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* PtrToXHand()
*
* Summary:
* Copies data referenced by a pointer to an existing relocatable
* block.
*
* Discussion:
* The PtrToXHand function copies the specified number of bytes from
* the location specified by srcPtr to the handle specified by
* dstHndl.
*
* Mac OS X threading:
* Thread safe since version 10.3
*
* Parameters:
*
* srcPtr:
* the address of the first byte to copy.
*
* dstHndl:
* a handle to an existing relocatable block.
*
* size:
* the number of bytes to copy.
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function PtrToXHand( srcPtr: {const} UnivPtr; dstHndl: Handle; size: SIGNEDLONG ): OSErr; external name '_PtrToXHand';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* PtrToHand()
*
* Summary:
* Copies data referenced by a pointer to a new relocatable block.
*
* Discussion:
* If you dereference and lock a handle, the PtrToHand function can
* copy its data to a new handle. However, for copying data from one
* handle to another, the HandToHand function is more efficient.
*
* Mac OS X threading:
* Thread safe since version 10.3
*
* Parameters:
*
* srcPtr:
* the address of the first byte to copy.
*
* dstHndl:
* a handle for which you have not yet allocated any memory. The
* PtrToHand function allocates memory for the handle and copies
* the specified number of bytes beginning at srcPtr into it. The
* dstHndl parameter is an output parameter that will hold the
* result. Its value on entry is ignored. If no error occurs, on
* exit it points to an unlocked, non-purgeable Handle of the
* requested size.
*
* size:
* the number of bytes to copy.
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function PtrToHand( srcPtr: {const} UnivPtr; var dstHndl: Handle; size: SIGNEDLONG ): OSErr; external name '_PtrToHand';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* HandAndHand()
*
* Summary:
* Use the HandAndHand function to concatenate two relocatable
* blocks.
*
* Discussion:
* The HandAndHand function concatenates the information from the
* relocatable block to which aHndl is a handle onto the end of the
* relocatable block to which bHndl is a handle. The aHndl variable
* remains unchanged.
*
* WARNING
*
* The HandAndHand function dereferences the handle aHndl. You must
* call the HLock procedure to lock the block before calling
* HandAndHand. Afterward, you can call the HUnlock procedure to
* unlock it. Alternatively, you can save the block's original state
* by calling the HGetState function, lock the block by calling
* HLock, and then restore the original settings by calling
* HSetState.
*
* Mac OS X threading:
* Thread safe since version 10.3
*
* Parameters:
*
* hand1:
* A handle to the first relocatable block, whose contents do not
* change but are concatenated to the end of the second
* relocatable block.
*
* hand2:
* A handle to the second relocatable block, whose size the Memory
* Manager expands so that it can concatenate the information from
* aHndl to the end of the contents of this block.
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function HandAndHand( hand1: Handle; hand2: Handle ): OSErr; external name '_HandAndHand';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{
* PtrAndHand()
*
* Summary:
* Concatenates part or all of a memory block to the end of a
* relocatable block.
*
* Discussion:
* The PtrAndHand function takes the number of bytes specified by
* the size parameter, beginning at the location specified by ptr1,
* and concatenates them onto the end of the relocatable block to
* which hand2 is a handle. The contents of the source block remain
* unchanged.
*
* Mac OS X threading:
* Thread safe since version 10.3
*
* Parameters:
*
* ptr1:
* a pointer to the beginning of the data that the Memory Manager
* is to concatenate onto the end of the relocatable block.
*
* hand2:
* a handle to the relocatable block, whose size the Memory
* Manager expands so that it can concatenate the information from
* ptr1 onto the end of this block.
*
* size:
* the number of bytes of the block referenced by ptr1 to copy.
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function PtrAndHand( ptr1: {const} UnivPtr; hand2: Handle; size: SIGNEDLONG ): OSErr; external name '_PtrAndHand';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{$ifc not TARGET_CPU_64}
{
* MoreMasters() *** DEPRECATED ***
*
* Discussion:
* On Mac OS X and later, master pointers do not need to be
* pre-allocated.
*
* Mac OS X threading:
* Not thread safe
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.4
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
procedure MoreMasters; external name '_MoreMasters';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
{
* MoreMasterPointers() *** DEPRECATED ***
*
* Discussion:
* On Mac OS X and later, master pointers do not need to be
* pre-allocated.
*
* Mac OS X threading:
* Not thread safe
*
* Parameters:
*
* inCount:
* the number of master pointers to preallocate
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.4
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: not available
}
procedure MoreMasterPointers( inCount: UInt32 ); external name '_MoreMasterPointers';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
{ Temporary Memory routines renamed, but obsolete, in System 7.0 and later. }
{
* TempHLock() *** DEPRECATED ***
*
* Discussion:
* This function has been deprecated for many years; replace it with
* HLock()
*
* Mac OS X threading:
* Not thread safe
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.4
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
procedure TempHLock( h: Handle; var resultCode: OSErr ); external name '_TempHLock';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
{
* TempHUnlock() *** DEPRECATED ***
*
* Discussion:
* This function has been deprecated for many years; replace it with
* HUnlock()
*
* Mac OS X threading:
* Not thread safe
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.4
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
procedure TempHUnlock( h: Handle; var resultCode: OSErr ); external name '_TempHUnlock';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
{
* TempDisposeHandle() *** DEPRECATED ***
*
* Discussion:
* This function has been deprecated for many years; replace it with
* DisposeHandle()
*
* Mac OS X threading:
* Not thread safe
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.5
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
procedure TempDisposeHandle( h: Handle; var resultCode: OSErr ); external name '_TempDisposeHandle';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 *)
{
* TempTopMem() *** DEPRECATED ***
*
* Discussion:
* Mac OS X and later does not have a seperate temporary memory
* heap. This function returns NULL.
*
* Mac OS X threading:
* Not thread safe
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.4
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function TempTopMem: Ptr; external name '_TempTopMem';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
{
* HoldMemory() *** DEPRECATED ***
*
* Deprecated:
* Mac OS X has never supported HoldMemory. The functions in
* ./sys/mman.h may be useful for replacing usage of these
* functions, although Mac OS X does not allow the same level of
* control over whether pages are held in memory or resident as Mac
* OS 9.x did.
* If you define a macro __MAC_OS_X_MEMORY_MANAGER_CLEAN__ in your
* sources before you include MacMemory.h, then any calls to
* HoldMemory() in your program will essentially be removed.
*
* Mac OS X threading:
* Not thread safe
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.4
* CarbonLib: in CarbonLib 1.1 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function HoldMemory( address: UnivPtr; count: UNSIGNEDLONG ): OSErr; external name '_HoldMemory';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
{
* UnholdMemory() *** DEPRECATED ***
*
* Deprecated:
* Mac OS X has never supported MakeMemoryResident. See the comment
* above UnholdMemory for more information.
*
* Mac OS X threading:
* Not thread safe
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.4
* CarbonLib: in CarbonLib 1.1 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function UnholdMemory( address: UnivPtr; count: UNSIGNEDLONG ): OSErr; external name '_UnholdMemory';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
{
* MakeMemoryResident() *** DEPRECATED ***
*
* Deprecated:
* Mac OS X has never supported MakeMemoryResident. See the comment
* above UnholdMemory for more information.
*
* Mac OS X threading:
* Not thread safe
*
* Parameters:
*
* address:
* the address to make resident
*
* count:
* the count of pages to make make resident
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.4
* CarbonLib: in CarbonLib 1.0.2 and later
* Non-Carbon CFM: in InterfaceLib 8.5 and later
}
function MakeMemoryResident( address: UnivPtr; count: UNSIGNEDLONG ): OSErr; external name '_MakeMemoryResident';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
{
* ReleaseMemoryData() *** DEPRECATED ***
*
* Deprecated:
* Mac OS X has never supported MakeMemoryResident. See the comment
* above UnholdMemory for more information.
*
* Mac OS X threading:
* Not thread safe
*
* Parameters:
*
* address:
* the address to make release
*
* count:
* the count of pages to make make release
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.4
* CarbonLib: in CarbonLib 1.0.2 and later
* Non-Carbon CFM: in InterfaceLib 8.5 and later
}
function ReleaseMemoryData( address: UnivPtr; count: UNSIGNEDLONG ): OSErr; external name '_ReleaseMemoryData';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
{
* MakeMemoryNonResident() *** DEPRECATED ***
*
* Deprecated:
* Mac OS X has never supported MakeMemoryResident. See the comment
* above UnholdMemory for more information.
*
* Mac OS X threading:
* Not thread safe
*
* Parameters:
*
* address:
* the address to make non-resident
*
* count:
* the count of pages to make make non-resident
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.4
* CarbonLib: in CarbonLib 1.0.2 and later
* Non-Carbon CFM: in InterfaceLib 8.5 and later
}
function MakeMemoryNonResident( address: UnivPtr; count: UNSIGNEDLONG ): OSErr; external name '_MakeMemoryNonResident';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
{
* FlushMemory() *** DEPRECATED ***
*
* Deprecated:
* Mac OS X has never supported MakeMemoryResident. See the comment
* above UnholdMemory for more information.
*
* Mac OS X threading:
* Not thread safe
*
* Parameters:
*
* address:
* the address to flush
*
* count:
* the count of pages to make flush
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.4
* CarbonLib: in CarbonLib 1.0.2 and later
* Non-Carbon CFM: in InterfaceLib 8.5 and later
}
function FlushMemory( address: UnivPtr; count: UNSIGNEDLONG ): OSErr; external name '_FlushMemory';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
{
* GZSaveHnd() *** DEPRECATED ***
*
* Summary:
* This function is deprecated on Mac OS X and always returns NULL.
*
* Mac OS X threading:
* Not thread safe
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.4
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function GZSaveHnd: Handle; external name '_GZSaveHnd';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
{
* TopMem() *** DEPRECATED ***
*
* Summary:
* This function is deprecated on Mac OS X and always returns NULL.
*
* Mac OS X threading:
* Not thread safe
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.4
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function TopMem: Ptr; external name '_TopMem';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
{
* ReserveMem() *** DEPRECATED ***
*
* Summary:
* This function is deprecated on Mac OS X.
*
* Mac OS X threading:
* Not thread safe
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.4
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
procedure ReserveMem( cbNeeded: Size ); external name '_ReserveMem';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
{
* PurgeSpace() *** DEPRECATED ***
*
* Summary:
* This function is deprecated on Mac OS X.
*
* Discussion:
* On Mac OS X and later, heaps are never purged and therefore
* PurgeSpace will always return a large value for both the total
* space available and the largest block available. You can assume
* that any reasonable memory allocation will succeed.
*
* If you define a macro __MAC_OS_X_MEMORY_MANAGER_CLEAN__ in your
* sources before you include MacMemory.h, then any calls to
* PurgeSpace() in your program will essentially be removed.
*
* Mac OS X threading:
* Not thread safe
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.4
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
procedure PurgeSpace( var total: SIGNEDLONG; var contig: SIGNEDLONG ); external name '_PurgeSpace';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
{
* PurgeSpaceTotal() *** DEPRECATED ***
*
* Summary:
* This function is deprecated on Mac OS X.
*
* Discussion:
* On Mac OS X and later, heaps are never purged and therefore
* PurgeSpaceTotal will always return a large value. You can assume
* that any reasonable memory allocation will succeed.
*
* Mac OS X threading:
* Not thread safe
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.4
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 8.5 and later
}
function PurgeSpaceTotal: SIGNEDLONG; external name '_PurgeSpaceTotal';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
{
* PurgeSpaceContiguous() *** DEPRECATED ***
*
* Summary:
* This function is deprecated on Mac OS X.
*
* Discussion:
* On Mac OS X and later, heaps are never purged and therefore
* PurgeSpaceContiguous will always return a large value. You can
* assume that any reasonable memory allocation will succeed.
*
* Mac OS X threading:
* Not thread safe
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.4
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 8.5 and later
}
function PurgeSpaceContiguous: SIGNEDLONG; external name '_PurgeSpaceContiguous';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
{ Carbon routines to aid in debugging. }
{
* CheckAllHeaps() *** DEPRECATED ***
*
* Summary:
* Check all known heaps for validity. Deprecated on Mac OS X,
* since there really aren't heaps. Use IsHeapValid() if you really
* want this functionality.
*
* Mac OS X threading:
* Not thread safe
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.4
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: not available
}
function CheckAllHeaps: Boolean; external name '_CheckAllHeaps';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
{$endc} {not TARGET_CPU_64}
{
* IsHeapValid()
*
* Summary:
* Check if the heap is valid.
*
* Mac OS X threading:
* Thread safe since version 10.4
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: not available
}
function IsHeapValid: Boolean; external name '_IsHeapValid';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{ It is invalid to pass a NULL or an empty Handle to IsHandleValid }
{
* IsHandleValid()
*
* Mac OS X threading:
* Thread safe since version 10.3
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: not available
}
function IsHandleValid( h: Handle ): Boolean; external name '_IsHandleValid';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{ It is invalid to pass a NULL Pointer to IsPointerValid }
{
* IsPointerValid()
*
* Mac OS X threading:
* Thread safe since version 10.3
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: not available
}
function IsPointerValid( p: Ptr ): Boolean; external name '_IsPointerValid';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
{$ifc not TARGET_CPU_64}
{
* LMGetSysZone() *** DEPRECATED ***
*
* Summary:
* This function is deprecated on Mac OS X.
*
* Mac OS X threading:
* Not thread safe
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.4
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function LMGetSysZone: THz; external name '_LMGetSysZone';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
{
* LMSetSysZone() *** DEPRECATED ***
*
* Summary:
* This function is deprecated on Mac OS X.
*
* Mac OS X threading:
* Not thread safe
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.4
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
procedure LMSetSysZone( value: THz ); external name '_LMSetSysZone';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
{
* LMGetApplZone() *** DEPRECATED ***
*
* Summary:
* This function is deprecated on Mac OS X.
*
* Mac OS X threading:
* Not thread safe
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.4
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
function LMGetApplZone: THz; external name '_LMGetApplZone';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
{
* LMSetApplZone() *** DEPRECATED ***
*
* Summary:
* This function is deprecated on Mac OS X.
*
* Mac OS X threading:
* Not thread safe
*
* Availability:
* Mac OS X: in version 10.0 and later in CoreServices.framework [32-bit only] but deprecated in 10.4
* CarbonLib: in CarbonLib 1.0 and later
* Non-Carbon CFM: in InterfaceLib 7.1 and later
}
procedure LMSetApplZone( value: THz ); external name '_LMSetApplZone';
(* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 *)
{$endc} {not TARGET_CPU_64}
{$endc} {TARGET_OS_MAC}
{$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
end.
{$endc} {not MACOSALLINCLUDE}
|