1
0

README 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. /**
  2. \defgroup lubheap "Little Useful Bits Heap" Library
  3. @{
  4. \section Overview
  5. This library can be linked with executables to override the standard memory
  6. management provided by the system libraries. This may provide a
  7. performance and debugging advantage.
  8. The implementation uses the \ref lub_heap component to control system memory
  9. and hence provides all the features available within that memory manager.
  10. (including leak detection)
  11. \section VxWorks
  12. Replaces the memPartLib.o, memLib.o and memShow.o found in the
  13. libos.a library archive.
  14. \subsection memlib memLib.o functions
  15. <code>
  16. calloc, cfree, memFindMax, memInit, memLibInit, memOptionsSet,
  17. memPartFindMax, memPartOptionsSet, memPartRealloc, memalign, realloc, valloc
  18. </code>
  19. \subsection mempartlib memPartLib.o functions
  20. <code>
  21. free, malloc, memAddToPool, memPartAddToPool, memPartAlignedAlloc,
  22. memPartAlloc, memPartBlockIsValid, memPartCreate, memPartFree,
  23. memPartInit, memPartLibInit
  24. </code>
  25. \subsection memshow memShow.o functions
  26. <code>
  27. memShow, memPartInfoGet, memParShow
  28. </code>
  29. \section posix POSIX
  30. Replaces the dynamic memory functionality found in the libc.a
  31. library archive.
  32. This implementation relies on the sbrk() function to provide memory
  33. chunks to feed the standard heap.
  34. \subsection Functions
  35. <code>
  36. calloc, cfree, free, malloc, memalign, realloc, valloc
  37. </code>
  38. \section Performance
  39. Running the unittests with this library provides the following comparisons on
  40. some test machines:
  41. \section x86_64-unknown-linux-gnu
  42. <TABLE>
  43. <TR>
  44. <TD><B>Native memory management</B> (<code>./test/mallocTest</code>)</TD>
  45. <TD><B>lubheap memory management</B> (<code>./test/lubMallocTest</code>)</TD>
  46. </TR>
  47. <TR>
  48. <TD>
  49. <PRE>
  50. *** 100 in 0 milliseconds
  51. *** 200 in 0 milliseconds
  52. *** 300 in 0 milliseconds
  53. *** 400 in 0 milliseconds
  54. *** 500 in 1 milliseconds
  55. *** 1000 in 3 milliseconds
  56. *** 2000 in 7 milliseconds
  57. *** 3000 in 12 milliseconds
  58. *** 4000 in 16 milliseconds
  59. *** 5000 in 21 milliseconds
  60. *** 10000 in 48 milliseconds
  61. *** 15000 in 79 milliseconds
  62. *** 20000 in 143 milliseconds
  63. *** 25000 in 200 milliseconds
  64. *** 30000 in 253 milliseconds
  65. *** 35000 in 314 milliseconds
  66. *** 40000 in 378 milliseconds
  67. *** 45000 in 460 milliseconds
  68. *** 50000 in 561 milliseconds
  69. *** 60000 in 790 milliseconds
  70. *** 70000 in 1036 milliseconds
  71. *** 80000 in 1320 milliseconds
  72. *** 90000 in 1653 milliseconds
  73. *** 100000 in 2037 milliseconds
  74. </PRE>
  75. </TD>
  76. <TD>
  77. <PRE>
  78. *** 100 in 0 milliseconds
  79. *** 200 in 0 milliseconds
  80. *** 300 in 0 milliseconds
  81. *** 400 in 1 milliseconds
  82. *** 500 in 1 milliseconds
  83. *** 1000 in 3 milliseconds
  84. *** 2000 in 6 milliseconds
  85. *** 3000 in 9 milliseconds
  86. *** 4000 in 11 milliseconds
  87. *** 5000 in 13 milliseconds
  88. *** 10000 in 37 milliseconds
  89. *** 15000 in 49 milliseconds
  90. *** 20000 in 61 milliseconds
  91. *** 25000 in 75 milliseconds
  92. *** 30000 in 89 milliseconds
  93. *** 35000 in 99 milliseconds
  94. *** 40000 in 113 milliseconds
  95. *** 45000 in 125 milliseconds
  96. *** 50000 in 138 milliseconds
  97. *** 60000 in 177 milliseconds
  98. *** 70000 in 203 milliseconds
  99. *** 80000 in 228 milliseconds
  100. *** 90000 in 254 milliseconds
  101. *** 100000 in 277 milliseconds
  102. </PRE>
  103. </TD>
  104. </TR>
  105. </TABLE>
  106. \section i686-pc-linux-gnu
  107. <TABLE>
  108. <TR>
  109. <TD><B>Native memory management</B> (<code>./test/mallocTest</code>)</TD>
  110. <TD><B>lubheap memory management</B> (<code>./test/lubMallocTest</code>)</TD>
  111. </TR>
  112. <TR>
  113. <TD>
  114. <PRE>
  115. *** 100 in 0 milliseconds
  116. *** 200 in 0 milliseconds
  117. *** 300 in 0 milliseconds
  118. *** 400 in 1 milliseconds
  119. *** 500 in 1 milliseconds
  120. *** 1000 in 3 milliseconds
  121. *** 2000 in 7 milliseconds
  122. *** 3000 in 12 milliseconds
  123. *** 4000 in 16 milliseconds
  124. *** 5000 in 21 milliseconds
  125. *** 10000 in 46 milliseconds
  126. *** 15000 in 76 milliseconds
  127. *** 20000 in 111 milliseconds
  128. *** 25000 in 151 milliseconds
  129. *** 30000 in 199 milliseconds
  130. *** 35000 in 256 milliseconds
  131. *** 40000 in 318 milliseconds
  132. *** 45000 in 393 milliseconds
  133. *** 50000 in 472 milliseconds
  134. *** 60000 in 658 milliseconds
  135. *** 70000 in 874 milliseconds
  136. *** 80000 in 1121 milliseconds
  137. *** 90000 in 1411 milliseconds
  138. *** 100000 in 1745 milliseconds
  139. </PRE>
  140. </TD>
  141. <TD>
  142. <PRE>
  143. *** 100 in 0 milliseconds
  144. *** 200 in 0 milliseconds
  145. *** 300 in 1 milliseconds
  146. *** 400 in 1 milliseconds
  147. *** 500 in 1 milliseconds
  148. *** 1000 in 4 milliseconds
  149. *** 2000 in 7 milliseconds
  150. *** 3000 in 11 milliseconds
  151. *** 4000 in 13 milliseconds
  152. *** 5000 in 15 milliseconds
  153. *** 10000 in 42 milliseconds
  154. *** 15000 in 57 milliseconds
  155. *** 20000 in 72 milliseconds
  156. *** 25000 in 89 milliseconds
  157. *** 30000 in 105 milliseconds
  158. *** 35000 in 121 milliseconds
  159. *** 40000 in 136 milliseconds
  160. *** 45000 in 154 milliseconds
  161. *** 50000 in 169 milliseconds
  162. *** 60000 in 213 milliseconds
  163. *** 70000 in 246 milliseconds
  164. *** 80000 in 278 milliseconds
  165. *** 90000 in 311 milliseconds
  166. *** 100000 in 341 milliseconds
  167. </PRE>
  168. </TD>
  169. </TR>
  170. </TABLE>
  171. \section i686-pc-cygwin
  172. For some reason the native memory management under cygwin is quicker. My suspcion is that there is an overhead in the
  173. <CODE>sbrk()</CODE> call via the cygwin sub-system which slows the lubheap implementation...
  174. <TABLE>
  175. <TR>
  176. <TD><B>Native memory management</B> (<code>./test/mallocTest</code>)</TD>
  177. <TD><B>lubheap memory management</B> (<code>./test/lubMallocTest</code>)</TD>
  178. </TR>
  179. <TR>
  180. <TD>
  181. <PRE>
  182. *** 100 in 0 milliseconds
  183. *** 200 in 0 milliseconds
  184. *** 300 in 0 milliseconds
  185. *** 400 in 0 milliseconds
  186. *** 500 in 0 milliseconds
  187. *** 1000 in 0 milliseconds
  188. *** 2000 in 0 milliseconds
  189. *** 3000 in 16 milliseconds
  190. *** 4000 in 15 milliseconds
  191. *** 5000 in 16 milliseconds
  192. *** 10000 in 31 milliseconds
  193. *** 15000 in 47 milliseconds
  194. *** 20000 in 63 milliseconds
  195. *** 25000 in 93 milliseconds
  196. *** 30000 in 125 milliseconds
  197. *** 35000 in 204 milliseconds
  198. *** 40000 in 203 milliseconds
  199. *** 45000 in 218 milliseconds
  200. *** 50000 in 266 milliseconds
  201. *** 60000 in 328 milliseconds
  202. *** 70000 in 360 milliseconds
  203. *** 80000 in 406 milliseconds
  204. *** 90000 in 500 milliseconds
  205. *** 100000 in 515 milliseconds
  206. </PRE>
  207. </TD>
  208. <TD>
  209. <PRE>
  210. *** 100 in 0 milliseconds
  211. *** 200 in 0 milliseconds
  212. *** 300 in 0 milliseconds
  213. *** 400 in 0 milliseconds
  214. *** 500 in 15 milliseconds
  215. *** 1000 in 0 milliseconds
  216. *** 2000 in 16 milliseconds
  217. *** 3000 in 31 milliseconds
  218. *** 4000 in 31 milliseconds
  219. *** 5000 in 47 milliseconds
  220. *** 10000 in 94 milliseconds
  221. *** 15000 in 156 milliseconds
  222. *** 20000 in 188 milliseconds
  223. *** 25000 in 250 milliseconds
  224. *** 30000 in 281 milliseconds
  225. *** 35000 in 375 milliseconds
  226. *** 40000 in 375 milliseconds
  227. *** 45000 in 453 milliseconds
  228. *** 50000 in 484 milliseconds
  229. *** 60000 in 625 milliseconds
  230. *** 70000 in 672 milliseconds
  231. *** 80000 in 813 milliseconds
  232. *** 90000 in 875 milliseconds
  233. *** 100000 in 984 milliseconds
  234. </PRE>
  235. </TD>
  236. </TR>
  237. </TABLE>
  238. @}
  239. */