home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ctdemo.zip / classes / @CLSLIB1.ZIP / cls / runtime / heap.cpp next >
C/C++ Source or Header  |  1994-05-11  |  5KB  |  282 lines

  1. #ifndef INCL_HEAP
  2. #define INCL_HEAP
  3.  
  4. #ifndef __FIRST__
  5. #define __FIRST__
  6. #define __IMPL__HEAP
  7. #endif
  8.  
  9. /////V Heap PCM f:\cls_ibm\cls\runtime 0 PM 20.10.94 19:37:13
  10.  
  11. /*
  12. /////H 
  13. 20.10.94 19:37 PM 0 copied from: Heap TOS f:\cls_ibm\cls\runtime 0 PM 19.10.94 00:26:01
  14. 30.03.95 10:34 PM 0 archived: Heap PCM f:\cls_ibm\cls\runtime 0 PM 20.10.94 19:37:13
  15. /////
  16. */
  17.  
  18. /////1
  19. #undef inline
  20.  
  21. #include <bsa.h>
  22.  
  23. /////T Defs pre 
  24. #define MAXBLOCKS    8
  25. /////
  26.  
  27.  
  28. #ifndef __INLINE__
  29. #define inline
  30. #endif
  31.  
  32. /////C Heap @ @ 
  33. class Heap
  34.  
  35. {
  36.  
  37. public:
  38.     static void     addStreamLabel (char*);
  39.     static ulong    bigAllocs ();
  40.     static ulong    bytesCommitted (ulong);
  41.     static ulong    bytesMaxBig ();
  42.     static ulong    bytesMinBig ();
  43.     static ulong    bytesUsed (ulong);
  44.     static int    isAllocated (void*);
  45.     static char*    logSpaceAccess ();
  46.     static void*    nextSpaceAccess (ulong,void*);
  47.     static ulong    occupation (ulong);
  48.     static ulong    pagesCommitted (ulong);
  49.     static ulong    pagesLeft (ulong);
  50.     static void*    pMemBase (ulong);
  51.     static void*    pMemGuard (ulong);
  52.     static void*    pMemTop (ulong);
  53.     static void     startTrace ();
  54.     static void     stopTrace ();
  55.     static ulong    tileAllocs (ulong);
  56.     static ulong    tileClusters (ulong);
  57.     static ulong    tileSize (ulong);
  58. };
  59.  
  60.  
  61. /////2
  62. #undef inline
  63.  
  64.  
  65. #if (defined __INLINE__) || (defined __IMPL__HEAP)
  66.  
  67. #ifndef __INLINE__
  68. #define inline
  69. #endif
  70.  
  71. /////
  72. #endif
  73.  
  74. /////3
  75. #undef inline
  76.  
  77. #ifdef __IMPL__HEAP
  78. /////
  79. #ifdef NEVER
  80. /////F addStreamLabel @ @ hideDef public class 
  81. void Heap:: addStreamLabel ( char* label )
  82. {
  83.     // implementation not visible
  84. }
  85. /////
  86. #endif
  87.  
  88. /////
  89. #ifdef NEVER
  90. /////F bigAllocs @ @ hideDef public class 
  91. ulong Heap:: bigAllocs ()
  92. {
  93.     // implementation not visible
  94. }
  95. /////
  96. #endif
  97.  
  98. /////
  99. #ifdef NEVER
  100. /////F bytesCommitted @ @ hideDef public class 
  101. ulong Heap:: bytesCommitted ( ulong blockIdx )
  102. {
  103.     // implementation not visible
  104. }
  105. /////
  106. #endif
  107.  
  108. /////
  109. #ifdef NEVER
  110. /////F bytesMaxBig @ @ hideDef public class 
  111. ulong Heap:: bytesMaxBig ()
  112. {
  113.     // implementation not visible
  114. }
  115. /////
  116. #endif
  117.  
  118. /////
  119. #ifdef NEVER
  120. /////F bytesMinBig @ @ hideDef public class 
  121. ulong Heap:: bytesMinBig ()
  122. {
  123.     // implementation not visible
  124. }
  125. /////
  126. #endif
  127.  
  128. /////
  129. #ifdef NEVER
  130. /////F bytesUsed @ @ hideDef public class 
  131. ulong Heap:: bytesUsed ( ulong blockIdx )
  132. {
  133.     // implementation not visible
  134. }
  135. /////
  136. #endif
  137.  
  138. /////
  139. #ifdef NEVER
  140. /////F isAllocated @ @ hideDef public class 
  141. int Heap:: isAllocated ( void* adr )
  142. {
  143.     // implementation not visible
  144. }
  145. /////
  146. #endif
  147.  
  148. /////
  149. #ifdef NEVER
  150. /////F logSpaceAccess @ @ hideDef public class 
  151. char* Heap:: logSpaceAccess ()
  152. {
  153.     // implementation not visible
  154. }
  155. /////
  156. #endif
  157.  
  158. /////
  159. #ifdef NEVER
  160. /////F nextSpaceAccess @ @ hideDef public class 
  161. void* Heap:: nextSpaceAccess ( ulong blockIdx, void* pStartAdr )
  162. {
  163.     // implementation not visible
  164. }
  165. /////
  166. #endif
  167.  
  168. /////
  169. #ifdef NEVER
  170. /////F occupation @ @ hideDef public class 
  171. ulong Heap:: occupation ( ulong blockIdx )
  172. {
  173.     // implementation not visible
  174. }
  175. /////
  176. #endif
  177.  
  178. /////
  179. #ifdef NEVER
  180. /////F pagesCommitted @ @ hideDef public class 
  181. ulong Heap:: pagesCommitted ( ulong blockIdx )
  182. {
  183.     // implementation not visible
  184. }
  185. /////
  186. #endif
  187.  
  188. /////
  189. #ifdef NEVER
  190. /////F pagesLeft @ @ hideDef public class 
  191. ulong Heap:: pagesLeft ( ulong blockIdx )
  192. {
  193.     // implementation not visible
  194. }
  195. /////
  196. #endif
  197.  
  198. /////
  199. #ifdef NEVER
  200. /////F pMemBase @ @ hideDef public class 
  201. void* Heap:: pMemBase ( ulong blockIdx )
  202. {
  203.     // implementation not visible
  204. }
  205. /////
  206. #endif
  207.  
  208. /////
  209. #ifdef NEVER
  210. /////F pMemGuard @ @ hideDef public class 
  211. void* Heap:: pMemGuard ( ulong blockIdx )
  212. {
  213.     // implementation not visible
  214. }
  215. /////
  216. #endif
  217.  
  218. /////
  219. #ifdef NEVER
  220. /////F pMemTop @ @ hideDef public class 
  221. void* Heap:: pMemTop ( ulong blockIdx )
  222. {
  223.     // implementation not visible
  224. }
  225. /////
  226. #endif
  227.  
  228. /////
  229. #ifdef NEVER
  230. /////F startTrace @ @ hideDef public class 
  231. void Heap:: startTrace ()
  232. {
  233.     // implementation not visible
  234. }
  235. /////
  236. #endif
  237.  
  238. /////
  239. #ifdef NEVER
  240. /////F stopTrace @ @ hideDef public class 
  241. void Heap:: stopTrace ()
  242. {
  243.     // implementation not visible
  244. }
  245. /////
  246. #endif
  247.  
  248. /////
  249. #ifdef NEVER
  250. /////F tileAllocs @ @ hideDef public class 
  251. ulong Heap:: tileAllocs ( ulong blockIdx )
  252. {
  253.     // implementation not visible
  254. }
  255. /////
  256. #endif
  257.  
  258. /////
  259. #ifdef NEVER
  260. /////F tileClusters @ @ hideDef public class 
  261. ulong Heap:: tileClusters ( ulong blockIdx )
  262. {
  263.     // implementation not visible
  264. }
  265. /////
  266. #endif
  267.  
  268. /////
  269. #ifdef NEVER
  270. /////F tileSize @ @ hideDef public class 
  271. ulong Heap:: tileSize ( ulong blockIdx )
  272. {
  273.     // implementation not visible
  274. }
  275. /////
  276. #endif
  277.  
  278. /////
  279. #endif
  280.  
  281. #endif
  282.