@shd101wyy/yo 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (339) hide show
  1. package/LICENSE.md +17 -0
  2. package/README.md +80 -0
  3. package/out/cjs/index.cjs +51 -0
  4. package/out/cjs/yo-cli.cjs +2158 -0
  5. package/out/esm/index.mjs +51 -0
  6. package/out/types/src/codegen/async/runtime.d.ts +2 -0
  7. package/out/types/src/codegen/async/state-code-gen.d.ts +10 -0
  8. package/out/types/src/codegen/async/state-machine.d.ts +13 -0
  9. package/out/types/src/codegen/c/collection.d.ts +3 -0
  10. package/out/types/src/codegen/codegen-c.d.ts +12 -0
  11. package/out/types/src/codegen/constants.d.ts +3 -0
  12. package/out/types/src/codegen/expressions/array.d.ts +4 -0
  13. package/out/types/src/codegen/expressions/generation.d.ts +11 -0
  14. package/out/types/src/codegen/expressions/index.d.ts +2 -0
  15. package/out/types/src/codegen/functions/collection.d.ts +5 -0
  16. package/out/types/src/codegen/functions/context.d.ts +57 -0
  17. package/out/types/src/codegen/functions/generation.d.ts +25 -0
  18. package/out/types/src/codegen/functions/index.d.ts +2 -0
  19. package/out/types/src/codegen/index.d.ts +20 -0
  20. package/out/types/src/codegen/parallelism/runtime.d.ts +2 -0
  21. package/out/types/src/codegen/types/collection.d.ts +8 -0
  22. package/out/types/src/codegen/types/generation.d.ts +13 -0
  23. package/out/types/src/codegen/types/index.d.ts +2 -0
  24. package/out/types/src/codegen/utils/fixup.d.ts +2 -0
  25. package/out/types/src/codegen/utils/index.d.ts +77 -0
  26. package/out/types/src/codegen/values/index.d.ts +1 -0
  27. package/out/types/src/emitter.d.ts +11 -0
  28. package/out/types/src/env.d.ts +85 -0
  29. package/out/types/src/error.d.ts +45 -0
  30. package/out/types/src/evaluator/async/await-analysis-types.d.ts +23 -0
  31. package/out/types/src/evaluator/async/await-analysis.d.ts +5 -0
  32. package/out/types/src/evaluator/builtins/alignof.d.ts +8 -0
  33. package/out/types/src/evaluator/builtins/and_or.d.ts +8 -0
  34. package/out/types/src/evaluator/builtins/arc_fns.d.ts +58 -0
  35. package/out/types/src/evaluator/builtins/array_fns.d.ts +0 -0
  36. package/out/types/src/evaluator/builtins/as.d.ts +8 -0
  37. package/out/types/src/evaluator/builtins/async_fns.d.ts +8 -0
  38. package/out/types/src/evaluator/builtins/compt_assert.d.ts +8 -0
  39. package/out/types/src/evaluator/builtins/compt_boolean_fns.d.ts +8 -0
  40. package/out/types/src/evaluator/builtins/compt_expect_error.d.ts +8 -0
  41. package/out/types/src/evaluator/builtins/compt_list_fns.d.ts +33 -0
  42. package/out/types/src/evaluator/builtins/compt_print.d.ts +8 -0
  43. package/out/types/src/evaluator/builtins/compt_string_fns.d.ts +8 -0
  44. package/out/types/src/evaluator/builtins/consume.d.ts +8 -0
  45. package/out/types/src/evaluator/builtins/drop.d.ts +8 -0
  46. package/out/types/src/evaluator/builtins/dup.d.ts +8 -0
  47. package/out/types/src/evaluator/builtins/expr_fns.d.ts +33 -0
  48. package/out/types/src/evaluator/builtins/future_fns.d.ts +8 -0
  49. package/out/types/src/evaluator/builtins/gc.d.ts +8 -0
  50. package/out/types/src/evaluator/builtins/gensym.d.ts +8 -0
  51. package/out/types/src/evaluator/builtins/impl_constraint.d.ts +8 -0
  52. package/out/types/src/evaluator/builtins/macro_expand.d.ts +8 -0
  53. package/out/types/src/evaluator/builtins/numeric_fns.d.ts +8 -0
  54. package/out/types/src/evaluator/builtins/panic.d.ts +8 -0
  55. package/out/types/src/evaluator/builtins/ptr_fns.d.ts +8 -0
  56. package/out/types/src/evaluator/builtins/quote.d.ts +13 -0
  57. package/out/types/src/evaluator/builtins/rc.d.ts +8 -0
  58. package/out/types/src/evaluator/builtins/sizeof.d.ts +8 -0
  59. package/out/types/src/evaluator/builtins/the.d.ts +8 -0
  60. package/out/types/src/evaluator/builtins/type_fns.d.ts +28 -0
  61. package/out/types/src/evaluator/builtins/va_start.d.ts +8 -0
  62. package/out/types/src/evaluator/builtins/var_fns.d.ts +18 -0
  63. package/out/types/src/evaluator/calls/array.d.ts +13 -0
  64. package/out/types/src/evaluator/calls/array_type.d.ts +11 -0
  65. package/out/types/src/evaluator/calls/closure_type.d.ts +11 -0
  66. package/out/types/src/evaluator/calls/compt_function.d.ts +19 -0
  67. package/out/types/src/evaluator/calls/compt_list_type.d.ts +11 -0
  68. package/out/types/src/evaluator/calls/function.d.ts +16 -0
  69. package/out/types/src/evaluator/calls/function_type.d.ts +15 -0
  70. package/out/types/src/evaluator/calls/helper.d.ts +42 -0
  71. package/out/types/src/evaluator/calls/iso.d.ts +15 -0
  72. package/out/types/src/evaluator/calls/module_type.d.ts +11 -0
  73. package/out/types/src/evaluator/calls/numeric_type.d.ts +15 -0
  74. package/out/types/src/evaluator/calls/pointer.d.ts +8 -0
  75. package/out/types/src/evaluator/calls/pointer_type.d.ts +14 -0
  76. package/out/types/src/evaluator/calls/type.d.ts +12 -0
  77. package/out/types/src/evaluator/context.d.ts +169 -0
  78. package/out/types/src/evaluator/exprs/_expr.d.ts +8 -0
  79. package/out/types/src/evaluator/exprs/assignment.d.ts +9 -0
  80. package/out/types/src/evaluator/exprs/begin.d.ts +10 -0
  81. package/out/types/src/evaluator/exprs/binding.d.ts +12 -0
  82. package/out/types/src/evaluator/exprs/c_include.d.ts +8 -0
  83. package/out/types/src/evaluator/exprs/cond.d.ts +8 -0
  84. package/out/types/src/evaluator/exprs/destructuring_assignment.d.ts +33 -0
  85. package/out/types/src/evaluator/exprs/exists.d.ts +0 -0
  86. package/out/types/src/evaluator/exprs/expr.d.ts +9 -0
  87. package/out/types/src/evaluator/exprs/extern.d.ts +8 -0
  88. package/out/types/src/evaluator/exprs/identifer_and_operator.d.ts +9 -0
  89. package/out/types/src/evaluator/exprs/import.d.ts +9 -0
  90. package/out/types/src/evaluator/exprs/initialization_assignment.d.ts +8 -0
  91. package/out/types/src/evaluator/exprs/match.d.ts +8 -0
  92. package/out/types/src/evaluator/exprs/open.d.ts +8 -0
  93. package/out/types/src/evaluator/exprs/property_access.d.ts +8 -0
  94. package/out/types/src/evaluator/exprs/recur.d.ts +8 -0
  95. package/out/types/src/evaluator/exprs/subtype_of.d.ts +21 -0
  96. package/out/types/src/evaluator/exprs/test.d.ts +8 -0
  97. package/out/types/src/evaluator/exprs/typeof.d.ts +8 -0
  98. package/out/types/src/evaluator/exprs/while.d.ts +8 -0
  99. package/out/types/src/evaluator/index.d.ts +26 -0
  100. package/out/types/src/evaluator/types/array.d.ts +8 -0
  101. package/out/types/src/evaluator/types/closure.d.ts +8 -0
  102. package/out/types/src/evaluator/types/compt_list.d.ts +8 -0
  103. package/out/types/src/evaluator/types/concrete_module.d.ts +8 -0
  104. package/out/types/src/evaluator/types/dyn.d.ts +8 -0
  105. package/out/types/src/evaluator/types/enum.d.ts +8 -0
  106. package/out/types/src/evaluator/types/expr_synthesizer.d.ts +14 -0
  107. package/out/types/src/evaluator/types/field.d.ts +14 -0
  108. package/out/types/src/evaluator/types/fn_module.d.ts +8 -0
  109. package/out/types/src/evaluator/types/function.d.ts +58 -0
  110. package/out/types/src/evaluator/types/future_module.d.ts +8 -0
  111. package/out/types/src/evaluator/types/module.d.ts +19 -0
  112. package/out/types/src/evaluator/types/newtype.d.ts +8 -0
  113. package/out/types/src/evaluator/types/object.d.ts +8 -0
  114. package/out/types/src/evaluator/types/proofs.d.ts +0 -0
  115. package/out/types/src/evaluator/types/slice.d.ts +8 -0
  116. package/out/types/src/evaluator/types/struct.d.ts +8 -0
  117. package/out/types/src/evaluator/types/synthesizer.d.ts +16 -0
  118. package/out/types/src/evaluator/types/tuple.d.ts +18 -0
  119. package/out/types/src/evaluator/types/union.d.ts +8 -0
  120. package/out/types/src/evaluator/types/utils.d.ts +71 -0
  121. package/out/types/src/evaluator/types/validation.d.ts +3 -0
  122. package/out/types/src/evaluator/utils/array-utils.d.ts +15 -0
  123. package/out/types/src/evaluator/utils/closure.d.ts +35 -0
  124. package/out/types/src/evaluator/utils.d.ts +4 -0
  125. package/out/types/src/evaluator/values/anonymous_function.d.ts +8 -0
  126. package/out/types/src/evaluator/values/anonymous_module.d.ts +17 -0
  127. package/out/types/src/evaluator/values/anonymous_struct.d.ts +8 -0
  128. package/out/types/src/evaluator/values/array.d.ts +8 -0
  129. package/out/types/src/evaluator/values/boolean.d.ts +3 -0
  130. package/out/types/src/evaluator/values/char.d.ts +3 -0
  131. package/out/types/src/evaluator/values/compt_list.d.ts +8 -0
  132. package/out/types/src/evaluator/values/dyn.d.ts +8 -0
  133. package/out/types/src/evaluator/values/float.d.ts +4 -0
  134. package/out/types/src/evaluator/values/integer.d.ts +4 -0
  135. package/out/types/src/evaluator/values/module.d.ts +58 -0
  136. package/out/types/src/evaluator/values/string.d.ts +3 -0
  137. package/out/types/src/evaluator/values/tuple.d.ts +32 -0
  138. package/out/types/src/expr.d.ts +456 -0
  139. package/out/types/src/function-value.d.ts +42 -0
  140. package/out/types/src/index.d.ts +4 -0
  141. package/out/types/src/lexer.d.ts +2 -0
  142. package/out/types/src/logger.d.ts +1 -0
  143. package/out/types/src/module-manager.d.ts +30 -0
  144. package/out/types/src/naming-checker.d.ts +4 -0
  145. package/out/types/src/parser.d.ts +33 -0
  146. package/out/types/src/test-runner.d.ts +30 -0
  147. package/out/types/src/tests/codegen.test.d.ts +1 -0
  148. package/out/types/src/tests/fixme.test.d.ts +1 -0
  149. package/out/types/src/tests/module-manager.test.d.ts +1 -0
  150. package/out/types/src/tests/parser.test.d.ts +1 -0
  151. package/out/types/src/tests/sample.test.d.ts +0 -0
  152. package/out/types/src/tests/std.test.d.ts +1 -0
  153. package/out/types/src/token.d.ts +40 -0
  154. package/out/types/src/type-value.d.ts +7 -0
  155. package/out/types/src/types/compatibility.d.ts +16 -0
  156. package/out/types/src/types/creators.d.ts +73 -0
  157. package/out/types/src/types/definitions.d.ts +218 -0
  158. package/out/types/src/types/guards.d.ts +70 -0
  159. package/out/types/src/types/hierarchy.d.ts +4 -0
  160. package/out/types/src/types/index.d.ts +7 -0
  161. package/out/types/src/types/module_field.d.ts +2 -0
  162. package/out/types/src/types/tags.d.ts +45 -0
  163. package/out/types/src/types/utils.d.ts +50 -0
  164. package/out/types/src/unit-value.d.ts +7 -0
  165. package/out/types/src/utils.d.ts +6 -0
  166. package/out/types/src/value-tag.d.ts +29 -0
  167. package/out/types/src/value.d.ts +110 -0
  168. package/out/types/src/yo-cli.d.ts +1 -0
  169. package/out/types/tsconfig.tsbuildinfo +1 -0
  170. package/package.json +57 -0
  171. package/scripts/check-liburing.js +76 -0
  172. package/std/alg/hash.yo +50 -0
  173. package/std/allocator.yo +113 -0
  174. package/std/allocators/c_allocator.yo +118 -0
  175. package/std/async.yo +13 -0
  176. package/std/collections/array_list.yo +415 -0
  177. package/std/collections/hash_map.yo +482 -0
  178. package/std/collections/hash_set.yo +706 -0
  179. package/std/collections/index.yo +11 -0
  180. package/std/collections/linked_list.yo +439 -0
  181. package/std/error.yo +0 -0
  182. package/std/gc.yo +10 -0
  183. package/std/index.yo +12 -0
  184. package/std/io/file.yo +191 -0
  185. package/std/io/index.yo +5 -0
  186. package/std/libc/assert.yo +39 -0
  187. package/std/libc/ctype.yo +57 -0
  188. package/std/libc/errno.yo +182 -0
  189. package/std/libc/float.yo +87 -0
  190. package/std/libc/index.yo +29 -0
  191. package/std/libc/limits.yo +65 -0
  192. package/std/libc/math.yo +679 -0
  193. package/std/libc/signal.yo +101 -0
  194. package/std/libc/stdatomic.yo +213 -0
  195. package/std/libc/stdint.yo +214 -0
  196. package/std/libc/stdio.yo +225 -0
  197. package/std/libc/stdlib.yo +204 -0
  198. package/std/libc/string.yo +151 -0
  199. package/std/libc/time.yo +92 -0
  200. package/std/libc/unistd.yo +130 -0
  201. package/std/monad.yo +152 -0
  202. package/std/prelude.yo +3094 -0
  203. package/std/string/index.yo +8 -0
  204. package/std/string/rune.yo +82 -0
  205. package/std/string/string.yo +288 -0
  206. package/std/sync.yo +95 -0
  207. package/std/thread.yo +36 -0
  208. package/std/time.yo +13 -0
  209. package/std/worker.yo +36 -0
  210. package/vendor/mimalloc/.gitattributes +12 -0
  211. package/vendor/mimalloc/CMakeLists.txt +763 -0
  212. package/vendor/mimalloc/LICENSE +21 -0
  213. package/vendor/mimalloc/SECURITY.md +41 -0
  214. package/vendor/mimalloc/azure-pipelines.yml +251 -0
  215. package/vendor/mimalloc/bin/mimalloc-redirect-arm64.dll +0 -0
  216. package/vendor/mimalloc/bin/mimalloc-redirect-arm64.lib +0 -0
  217. package/vendor/mimalloc/bin/mimalloc-redirect-arm64ec.dll +0 -0
  218. package/vendor/mimalloc/bin/mimalloc-redirect-arm64ec.lib +0 -0
  219. package/vendor/mimalloc/bin/mimalloc-redirect.dll +0 -0
  220. package/vendor/mimalloc/bin/mimalloc-redirect.lib +0 -0
  221. package/vendor/mimalloc/bin/mimalloc-redirect32.dll +0 -0
  222. package/vendor/mimalloc/bin/mimalloc-redirect32.lib +0 -0
  223. package/vendor/mimalloc/bin/minject-arm64.exe +0 -0
  224. package/vendor/mimalloc/bin/minject.exe +0 -0
  225. package/vendor/mimalloc/bin/minject32.exe +0 -0
  226. package/vendor/mimalloc/bin/readme.md +118 -0
  227. package/vendor/mimalloc/cmake/JoinPaths.cmake +23 -0
  228. package/vendor/mimalloc/cmake/mimalloc-config-version.cmake +19 -0
  229. package/vendor/mimalloc/cmake/mimalloc-config.cmake +14 -0
  230. package/vendor/mimalloc/contrib/docker/alpine/Dockerfile +23 -0
  231. package/vendor/mimalloc/contrib/docker/alpine-arm32v7/Dockerfile +28 -0
  232. package/vendor/mimalloc/contrib/docker/alpine-x86/Dockerfile +28 -0
  233. package/vendor/mimalloc/contrib/docker/manylinux-x64/Dockerfile +23 -0
  234. package/vendor/mimalloc/contrib/docker/readme.md +10 -0
  235. package/vendor/mimalloc/contrib/vcpkg/portfile.cmake +64 -0
  236. package/vendor/mimalloc/contrib/vcpkg/readme.md +40 -0
  237. package/vendor/mimalloc/contrib/vcpkg/usage +20 -0
  238. package/vendor/mimalloc/contrib/vcpkg/vcpkg-cmake-wrapper.cmake +20 -0
  239. package/vendor/mimalloc/contrib/vcpkg/vcpkg.json +48 -0
  240. package/vendor/mimalloc/doc/bench-2020/bench-c5-18xlarge-2020-01-20-a.svg +887 -0
  241. package/vendor/mimalloc/doc/bench-2020/bench-c5-18xlarge-2020-01-20-b.svg +1185 -0
  242. package/vendor/mimalloc/doc/bench-2020/bench-c5-18xlarge-2020-01-20-rss-a.svg +757 -0
  243. package/vendor/mimalloc/doc/bench-2020/bench-c5-18xlarge-2020-01-20-rss-b.svg +1028 -0
  244. package/vendor/mimalloc/doc/bench-2020/bench-r5a-1.svg +769 -0
  245. package/vendor/mimalloc/doc/bench-2020/bench-r5a-12xlarge-2020-01-16-a.svg +868 -0
  246. package/vendor/mimalloc/doc/bench-2020/bench-r5a-12xlarge-2020-01-16-b.svg +1157 -0
  247. package/vendor/mimalloc/doc/bench-2020/bench-r5a-2.svg +983 -0
  248. package/vendor/mimalloc/doc/bench-2020/bench-r5a-rss-1.svg +683 -0
  249. package/vendor/mimalloc/doc/bench-2020/bench-r5a-rss-2.svg +854 -0
  250. package/vendor/mimalloc/doc/bench-2020/bench-spec-rss.svg +713 -0
  251. package/vendor/mimalloc/doc/bench-2020/bench-spec.svg +713 -0
  252. package/vendor/mimalloc/doc/bench-2020/bench-z4-1.svg +890 -0
  253. package/vendor/mimalloc/doc/bench-2020/bench-z4-2.svg +1146 -0
  254. package/vendor/mimalloc/doc/bench-2020/bench-z4-rss-1.svg +796 -0
  255. package/vendor/mimalloc/doc/bench-2020/bench-z4-rss-2.svg +974 -0
  256. package/vendor/mimalloc/doc/bench-2021/bench-amd5950x-2021-01-30-a.svg +952 -0
  257. package/vendor/mimalloc/doc/bench-2021/bench-amd5950x-2021-01-30-b.svg +1255 -0
  258. package/vendor/mimalloc/doc/bench-2021/bench-c5-18xlarge-2021-01-30-a.svg +955 -0
  259. package/vendor/mimalloc/doc/bench-2021/bench-c5-18xlarge-2021-01-30-b.svg +1269 -0
  260. package/vendor/mimalloc/doc/bench-2021/bench-c5-18xlarge-2021-01-30-rss-a.svg +836 -0
  261. package/vendor/mimalloc/doc/bench-2021/bench-c5-18xlarge-2021-01-30-rss-b.svg +1131 -0
  262. package/vendor/mimalloc/doc/bench-2021/bench-macmini-2021-01-30.svg +766 -0
  263. package/vendor/mimalloc/doc/doxyfile +2895 -0
  264. package/vendor/mimalloc/doc/ds-logo.jpg +0 -0
  265. package/vendor/mimalloc/doc/ds-logo.png +0 -0
  266. package/vendor/mimalloc/doc/mimalloc-doc.h +1452 -0
  267. package/vendor/mimalloc/doc/mimalloc-doxygen.css +60 -0
  268. package/vendor/mimalloc/doc/mimalloc-logo-100.png +0 -0
  269. package/vendor/mimalloc/doc/mimalloc-logo.png +0 -0
  270. package/vendor/mimalloc/doc/mimalloc-logo.svg +161 -0
  271. package/vendor/mimalloc/doc/spades-logo.png +0 -0
  272. package/vendor/mimalloc/doc/unreal-logo.svg +43 -0
  273. package/vendor/mimalloc/ide/vs2022/mimalloc-lib.vcxproj +500 -0
  274. package/vendor/mimalloc/ide/vs2022/mimalloc-lib.vcxproj.filters +108 -0
  275. package/vendor/mimalloc/ide/vs2022/mimalloc-override-dll.vcxproj +508 -0
  276. package/vendor/mimalloc/ide/vs2022/mimalloc-override-dll.vcxproj.filters +111 -0
  277. package/vendor/mimalloc/ide/vs2022/mimalloc-override-test-dep.vcxproj +355 -0
  278. package/vendor/mimalloc/ide/vs2022/mimalloc-override-test.vcxproj +360 -0
  279. package/vendor/mimalloc/ide/vs2022/mimalloc-test-api.vcxproj +295 -0
  280. package/vendor/mimalloc/ide/vs2022/mimalloc-test-stress.vcxproj +292 -0
  281. package/vendor/mimalloc/ide/vs2022/mimalloc-test.vcxproj +289 -0
  282. package/vendor/mimalloc/ide/vs2022/mimalloc.sln +151 -0
  283. package/vendor/mimalloc/include/mimalloc/atomic.h +557 -0
  284. package/vendor/mimalloc/include/mimalloc/internal.h +1153 -0
  285. package/vendor/mimalloc/include/mimalloc/prim.h +421 -0
  286. package/vendor/mimalloc/include/mimalloc/track.h +145 -0
  287. package/vendor/mimalloc/include/mimalloc/types.h +685 -0
  288. package/vendor/mimalloc/include/mimalloc-new-delete.h +66 -0
  289. package/vendor/mimalloc/include/mimalloc-override.h +68 -0
  290. package/vendor/mimalloc/include/mimalloc-stats.h +103 -0
  291. package/vendor/mimalloc/include/mimalloc.h +612 -0
  292. package/vendor/mimalloc/mimalloc.pc.in +11 -0
  293. package/vendor/mimalloc/readme.md +946 -0
  294. package/vendor/mimalloc/src/alloc-aligned.c +360 -0
  295. package/vendor/mimalloc/src/alloc-override.c +316 -0
  296. package/vendor/mimalloc/src/alloc-posix.c +185 -0
  297. package/vendor/mimalloc/src/alloc.c +692 -0
  298. package/vendor/mimalloc/src/arena-abandon.c +346 -0
  299. package/vendor/mimalloc/src/arena.c +1043 -0
  300. package/vendor/mimalloc/src/bitmap.c +441 -0
  301. package/vendor/mimalloc/src/bitmap.h +119 -0
  302. package/vendor/mimalloc/src/free.c +572 -0
  303. package/vendor/mimalloc/src/heap.c +733 -0
  304. package/vendor/mimalloc/src/init.c +714 -0
  305. package/vendor/mimalloc/src/libc.c +334 -0
  306. package/vendor/mimalloc/src/options.c +663 -0
  307. package/vendor/mimalloc/src/os.c +770 -0
  308. package/vendor/mimalloc/src/page-queue.c +390 -0
  309. package/vendor/mimalloc/src/page.c +1049 -0
  310. package/vendor/mimalloc/src/prim/emscripten/prim.c +249 -0
  311. package/vendor/mimalloc/src/prim/osx/alloc-override-zone.c +461 -0
  312. package/vendor/mimalloc/src/prim/osx/prim.c +9 -0
  313. package/vendor/mimalloc/src/prim/prim.c +76 -0
  314. package/vendor/mimalloc/src/prim/readme.md +9 -0
  315. package/vendor/mimalloc/src/prim/unix/prim.c +934 -0
  316. package/vendor/mimalloc/src/prim/wasi/prim.c +284 -0
  317. package/vendor/mimalloc/src/prim/windows/etw-mimalloc.wprp +61 -0
  318. package/vendor/mimalloc/src/prim/windows/etw.h +905 -0
  319. package/vendor/mimalloc/src/prim/windows/etw.man +0 -0
  320. package/vendor/mimalloc/src/prim/windows/prim.c +878 -0
  321. package/vendor/mimalloc/src/prim/windows/readme.md +17 -0
  322. package/vendor/mimalloc/src/random.c +258 -0
  323. package/vendor/mimalloc/src/segment-map.c +142 -0
  324. package/vendor/mimalloc/src/segment.c +1702 -0
  325. package/vendor/mimalloc/src/static.c +41 -0
  326. package/vendor/mimalloc/src/stats.c +635 -0
  327. package/vendor/mimalloc/test/CMakeLists.txt +56 -0
  328. package/vendor/mimalloc/test/main-override-dep.cpp +51 -0
  329. package/vendor/mimalloc/test/main-override-dep.h +11 -0
  330. package/vendor/mimalloc/test/main-override-static.c +539 -0
  331. package/vendor/mimalloc/test/main-override.c +36 -0
  332. package/vendor/mimalloc/test/main-override.cpp +497 -0
  333. package/vendor/mimalloc/test/main.c +46 -0
  334. package/vendor/mimalloc/test/readme.md +16 -0
  335. package/vendor/mimalloc/test/test-api-fill.c +343 -0
  336. package/vendor/mimalloc/test/test-api.c +466 -0
  337. package/vendor/mimalloc/test/test-stress.c +428 -0
  338. package/vendor/mimalloc/test/test-wrong.c +92 -0
  339. package/vendor/mimalloc/test/testhelper.h +49 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2018-2025 Microsoft Corporation, Daan Leijen
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,41 @@
1
+ <!-- BEGIN MICROSOFT SECURITY.MD V0.0.9 BLOCK -->
2
+
3
+ ## Security
4
+
5
+ Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet) and [Xamarin](https://github.com/xamarin).
6
+
7
+ If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/security.md/definition), please report it to us as described below.
8
+
9
+ ## Reporting Security Issues
10
+
11
+ **Please do not report security vulnerabilities through public GitHub issues.**
12
+
13
+ Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/security.md/msrc/create-report).
14
+
15
+ If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/security.md/msrc/pgp).
16
+
17
+ You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc).
18
+
19
+ Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
20
+
21
+ * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
22
+ * Full paths of source file(s) related to the manifestation of the issue
23
+ * The location of the affected source code (tag/branch/commit or direct URL)
24
+ * Any special configuration required to reproduce the issue
25
+ * Step-by-step instructions to reproduce the issue
26
+ * Proof-of-concept or exploit code (if possible)
27
+ * Impact of the issue, including how an attacker might exploit the issue
28
+
29
+ This information will help us triage your report more quickly.
30
+
31
+ If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/security.md/msrc/bounty) page for more details about our active programs.
32
+
33
+ ## Preferred Languages
34
+
35
+ We prefer all communications to be in English.
36
+
37
+ ## Policy
38
+
39
+ Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/security.md/cvd).
40
+
41
+ <!-- END MICROSOFT SECURITY.MD BLOCK -->
@@ -0,0 +1,251 @@
1
+ # Starter pipeline
2
+ # Start with a minimal pipeline that you can customize to build and deploy your code.
3
+ # Add steps that build, run tests, deploy, and more:
4
+ # https://aka.ms/yaml
5
+
6
+ trigger:
7
+ branches:
8
+ include:
9
+ - main
10
+ - dev*
11
+ tags:
12
+ include:
13
+ - v*
14
+
15
+ jobs:
16
+ - job:
17
+ displayName: Windows 2022
18
+ pool:
19
+ vmImage:
20
+ windows-2022
21
+ strategy:
22
+ matrix:
23
+ Debug:
24
+ BuildType: debug
25
+ cmakeExtraArgs: -DCMAKE_BUILD_TYPE=Debug -DMI_DEBUG_FULL=ON
26
+ MSBuildConfiguration: Debug
27
+ Release:
28
+ BuildType: release
29
+ cmakeExtraArgs: -DCMAKE_BUILD_TYPE=Release
30
+ MSBuildConfiguration: Release
31
+ Secure:
32
+ BuildType: secure
33
+ cmakeExtraArgs: -DCMAKE_BUILD_TYPE=Release -DMI_SECURE=ON
34
+ MSBuildConfiguration: Release
35
+ Debug x86:
36
+ BuildType: debug
37
+ cmakeExtraArgs: -DCMAKE_BUILD_TYPE=Debug -DMI_DEBUG_FULL=ON -A Win32
38
+ MSBuildConfiguration: Debug
39
+ Release x86:
40
+ BuildType: release
41
+ cmakeExtraArgs: -DCMAKE_BUILD_TYPE=Release -A Win32
42
+ MSBuildConfiguration: Release
43
+ Debug Fixed TLS:
44
+ BuildType: debug
45
+ cmakeExtraArgs: -DCMAKE_BUILD_TYPE=Debug -DMI_DEBUG_FULL=ON -DMI_WIN_USE_FIXED_TLS=ON
46
+ MSBuildConfiguration: Debug
47
+ Release Fixed TLS:
48
+ BuildType: release
49
+ cmakeExtraArgs: -DCMAKE_BUILD_TYPE=Release -DMI_WIN_USE_FIXED_TLS=ON
50
+ MSBuildConfiguration: Release
51
+ steps:
52
+ - task: CMake@1
53
+ inputs:
54
+ workingDirectory: $(BuildType)
55
+ cmakeArgs: .. $(cmakeExtraArgs)
56
+ - task: MSBuild@1
57
+ inputs:
58
+ solution: $(BuildType)/libmimalloc.sln
59
+ configuration: '$(MSBuildConfiguration)'
60
+ msbuildArguments: -m
61
+ - script: ctest --verbose --timeout 240 -C $(MSBuildConfiguration)
62
+ workingDirectory: $(BuildType)
63
+ displayName: CTest
64
+ #- script: $(BuildType)\$(BuildType)\mimalloc-test-stress
65
+ # displayName: TestStress
66
+ #- upload: $(Build.SourcesDirectory)/$(BuildType)
67
+ # artifact: mimalloc-windows-$(BuildType)
68
+
69
+ - job:
70
+ displayName: Ubuntu 22.04
71
+ pool:
72
+ vmImage:
73
+ ubuntu-22.04
74
+ strategy:
75
+ matrix:
76
+ Debug:
77
+ CC: gcc
78
+ CXX: g++
79
+ BuildType: debug
80
+ cmakeExtraArgs: -DCMAKE_BUILD_TYPE=Debug -DMI_DEBUG_FULL=ON
81
+ Release:
82
+ CC: gcc
83
+ CXX: g++
84
+ BuildType: release
85
+ cmakeExtraArgs: -DCMAKE_BUILD_TYPE=Release
86
+ Secure:
87
+ CC: gcc
88
+ CXX: g++
89
+ BuildType: secure
90
+ cmakeExtraArgs: -DCMAKE_BUILD_TYPE=Release -DMI_SECURE=ON
91
+ Debug++:
92
+ CC: gcc
93
+ CXX: g++
94
+ BuildType: debug-cxx
95
+ cmakeExtraArgs: -DCMAKE_BUILD_TYPE=Debug -DMI_DEBUG_FULL=ON -DMI_USE_CXX=ON
96
+ Debug Clang:
97
+ CC: clang
98
+ CXX: clang++
99
+ BuildType: debug-clang
100
+ cmakeExtraArgs: -DCMAKE_BUILD_TYPE=Debug -DMI_DEBUG_FULL=ON
101
+ Release Clang:
102
+ CC: clang
103
+ CXX: clang++
104
+ BuildType: release-clang
105
+ cmakeExtraArgs: -DCMAKE_BUILD_TYPE=Release
106
+ Secure Clang:
107
+ CC: clang
108
+ CXX: clang++
109
+ BuildType: secure-clang
110
+ cmakeExtraArgs: -DCMAKE_BUILD_TYPE=Release -DMI_SECURE=ON
111
+ Debug++ Clang:
112
+ CC: clang
113
+ CXX: clang++
114
+ BuildType: debug-clang-cxx
115
+ cmakeExtraArgs: -DCMAKE_BUILD_TYPE=Debug -DMI_DEBUG_FULL=ON -DMI_USE_CXX=ON
116
+ Debug ASAN Clang:
117
+ CC: clang
118
+ CXX: clang++
119
+ BuildType: debug-asan-clang
120
+ cmakeExtraArgs: -DCMAKE_BUILD_TYPE=Debug -DMI_DEBUG_FULL=ON -DMI_TRACK_ASAN=ON
121
+ Debug UBSAN Clang:
122
+ CC: clang
123
+ CXX: clang++
124
+ BuildType: debug-ubsan-clang
125
+ cmakeExtraArgs: -DCMAKE_BUILD_TYPE=Debug -DMI_DEBUG_FULL=ON -DMI_DEBUG_UBSAN=ON
126
+ Debug TSAN Clang++:
127
+ CC: clang
128
+ CXX: clang++
129
+ BuildType: debug-tsan-clang-cxx
130
+ cmakeExtraArgs: -DCMAKE_BUILD_TYPE=RelWithDebInfo -DMI_USE_CXX=ON -DMI_DEBUG_TSAN=ON
131
+ Debug Guarded Clang:
132
+ CC: clang
133
+ CXX: clang
134
+ BuildType: debug-guarded-clang
135
+ cmakeExtraArgs: -DCMAKE_BUILD_TYPE=RelWithDebInfo -DMI_DEBUG_FULL=ON -DMI_GUARDED=ON
136
+
137
+ steps:
138
+ - task: CMake@1
139
+ inputs:
140
+ workingDirectory: $(BuildType)
141
+ cmakeArgs: .. $(cmakeExtraArgs)
142
+ - script: make -j$(nproc) -C $(BuildType)
143
+ displayName: Make
144
+ - script: ctest --verbose --timeout 240
145
+ workingDirectory: $(BuildType)
146
+ displayName: CTest
147
+ env:
148
+ MIMALLOC_GUARDED_SAMPLE_RATE: 1000
149
+ # - upload: $(Build.SourcesDirectory)/$(BuildType)
150
+ # artifact: mimalloc-ubuntu-$(BuildType)
151
+
152
+ - job:
153
+ displayName: macOS 14 (Sonoma)
154
+ pool:
155
+ vmImage:
156
+ macOS-14
157
+ strategy:
158
+ matrix:
159
+ Debug:
160
+ BuildType: debug
161
+ cmakeExtraArgs: -DCMAKE_BUILD_TYPE=Debug -DMI_DEBUG_FULL=ON
162
+ Release:
163
+ BuildType: release
164
+ cmakeExtraArgs: -DCMAKE_BUILD_TYPE=Release
165
+ Secure:
166
+ BuildType: secure
167
+ cmakeExtraArgs: -DCMAKE_BUILD_TYPE=Release -DMI_SECURE=ON
168
+ steps:
169
+ - task: CMake@1
170
+ inputs:
171
+ workingDirectory: $(BuildType)
172
+ cmakeArgs: .. $(cmakeExtraArgs)
173
+ - script: make -j$(sysctl -n hw.ncpu) -C $(BuildType)
174
+ displayName: Make
175
+ - script: ctest --verbose --timeout 240
176
+ workingDirectory: $(BuildType)
177
+ displayName: CTest
178
+
179
+ # - upload: $(Build.SourcesDirectory)/$(BuildType)
180
+ # artifact: mimalloc-macos-$(BuildType)
181
+
182
+ # ----------------------------------------------------------
183
+ # Other OS versions (just debug mode)
184
+ # ----------------------------------------------------------
185
+
186
+ - job:
187
+ displayName: Ubuntu 24.04
188
+ pool:
189
+ vmImage:
190
+ ubuntu-24.04
191
+ strategy:
192
+ matrix:
193
+ Debug:
194
+ CC: gcc
195
+ CXX: g++
196
+ BuildType: debug
197
+ cmakeExtraArgs: -DCMAKE_BUILD_TYPE=Debug -DMI_DEBUG_FULL=ON
198
+ Debug++:
199
+ CC: gcc
200
+ CXX: g++
201
+ BuildType: debug-cxx
202
+ cmakeExtraArgs: -DCMAKE_BUILD_TYPE=Debug -DMI_DEBUG_FULL=ON -DMI_USE_CXX=ON
203
+ Debug Clang:
204
+ CC: clang
205
+ CXX: clang++
206
+ BuildType: debug-clang
207
+ cmakeExtraArgs: -DCMAKE_BUILD_TYPE=Debug -DMI_DEBUG_FULL=ON
208
+ Debug++ Clang:
209
+ CC: clang
210
+ CXX: clang++
211
+ BuildType: debug-clang-cxx
212
+ cmakeExtraArgs: -DCMAKE_BUILD_TYPE=Debug -DMI_DEBUG_FULL=ON -DMI_USE_CXX=ON
213
+ Release Clang:
214
+ CC: clang
215
+ CXX: clang++
216
+ BuildType: release-clang
217
+ cmakeExtraArgs: -DCMAKE_BUILD_TYPE=Release
218
+ steps:
219
+ - task: CMake@1
220
+ inputs:
221
+ workingDirectory: $(BuildType)
222
+ cmakeArgs: .. $(cmakeExtraArgs)
223
+ - script: make -j$(nproc) -C $(BuildType)
224
+ displayName: Make
225
+ - script: ctest --verbose --timeout 240
226
+ workingDirectory: $(BuildType)
227
+ displayName: CTest
228
+
229
+ - job:
230
+ displayName: macOS 15 (Sequoia)
231
+ pool:
232
+ vmImage:
233
+ macOS-15
234
+ strategy:
235
+ matrix:
236
+ Debug:
237
+ BuildType: debug
238
+ cmakeExtraArgs: -DCMAKE_BUILD_TYPE=Debug -DMI_DEBUG_FULL=ON
239
+ Release:
240
+ BuildType: release
241
+ cmakeExtraArgs: -DCMAKE_BUILD_TYPE=Release
242
+ steps:
243
+ - task: CMake@1
244
+ inputs:
245
+ workingDirectory: $(BuildType)
246
+ cmakeArgs: .. $(cmakeExtraArgs)
247
+ - script: make -j$(sysctl -n hw.ncpu) -C $(BuildType)
248
+ displayName: Make
249
+ - script: ctest --verbose --timeout 240
250
+ workingDirectory: $(BuildType)
251
+ displayName: CTest
Binary file
@@ -0,0 +1,118 @@
1
+ # Windows Override
2
+
3
+ <span id="override_on_windows">We use a separate redirection DLL to override mimalloc on Windows</span>
4
+ such that we redirect all malloc/free calls that go through the (dynamic) C runtime allocator,
5
+ including those from other DLL's or libraries. As it intercepts all allocation calls on a low level,
6
+ it can be used on large programs that include other 3rd party components.
7
+ There are four requirements to make the overriding work well:
8
+
9
+ 1. Use the C-runtime library as a DLL (using the `/MD` or `/MDd` switch).
10
+
11
+ 2. Link your program explicitly with the `mimalloc.dll.lib` export library for
12
+ the `mimalloc.dll` -- which contains all mimalloc functionality.
13
+ To ensure the `mimalloc.dll` is actually loaded at run-time it is easiest
14
+ to insert some call to the mimalloc API in the `main` function, like `mi_version()`
15
+ (or use the `/include:mi_version` switch on the linker, or
16
+ similarly, `#pragma comment(linker, "/include:mi_version")` in some source file).
17
+ See the `mimalloc-test-override` project for an example on how to use this.
18
+
19
+ 3. The `mimalloc-redirect.dll` must be put in the same folder as the main
20
+ `mimalloc.dll` at runtime (as it is a dependency of that DLL).
21
+ The redirection DLL ensures that all calls to the C runtime malloc API get
22
+ redirected to mimalloc functions (which reside in `mimalloc.dll`).
23
+
24
+ 4. Ensure the `mimalloc.dll` comes as early as possible in the import
25
+ list of the final executable (so it can intercept all potential allocations).
26
+ You can use `minject -l <exe>` to check this if needed.
27
+
28
+ ```csharp
29
+ ┌──────────────┐
30
+ │ Your Program │
31
+ └────┬─────────┘
32
+
33
+ │ mi_version() ┌───────────────┐ ┌───────────────────────┐
34
+ ├──────────────►│ mimalloc.dll ├────►│ mimalloc-redirect.dll │
35
+ │ └──────┬────────┘ └───────────────────────┘
36
+ │ ▼
37
+ │ malloc() etc. ┌──────────────┐
38
+ ├──────────────►│ ucrtbase.dll │
39
+ │ └──────────────┘
40
+
41
+
42
+ └──────────────► ...
43
+ ```
44
+
45
+ For best performance on Windows with C++, it
46
+ is also recommended to also override the `new`/`delete` operations (by including
47
+ [`mimalloc-new-delete.h`](../include/mimalloc-new-delete.h)
48
+ a single(!) source file in your project).
49
+
50
+ The environment variable `MIMALLOC_DISABLE_REDIRECT=1` can be used to disable dynamic
51
+ overriding at run-time. Use `MIMALLOC_VERBOSE=1` to check if mimalloc was successfully
52
+ redirected.
53
+
54
+ ### Other Platforms
55
+
56
+ You always link with `mimalloc.dll` but for different platforms you may
57
+ need a specific redirection DLL:
58
+
59
+ - __x64__: `mimalloc-redirect.dll`.
60
+ - __x86__: `mimalloc-redirect32.dll`. Use for older 32-bit Windows programs.
61
+ - __arm64__: `mimalloc-redirect-arm64.dll`. Use for native Windows arm64 programs.
62
+ - __arm64ec__: `mimalloc-redirect-arm64ec.dll`. The [arm64ec] ABI is "emulation compatible"
63
+ mode on Windows arm64. Unfortunately we cannot run x64 code emulated on Windows arm64 with
64
+ the x64 mimalloc override directly (since the C runtime always uses `arm64ec`). Instead:
65
+ 1. Build the program as normal for x64 and link as normal with the x64
66
+ `mimalloc.lib` export library.
67
+ 2. Now separately build `mimalloc.dll` in `arm64ec` mode and _overwrite_ your
68
+ previous (x64) `mimalloc.dll` -- the loader can handle the mix of arm64ec
69
+ and x64 code. Now use `mimalloc-redirect-arm64ec.dll` to match your new
70
+ arm64ec `mimalloc.dll`. The main program stays as is and can be fully x64
71
+ or contain more arm64ec modules. At runtime, the arm64ec `mimalloc.dll` will
72
+ run with native arm64 instructions while the rest of the program runs emulated x64.
73
+
74
+ [arm64ec]: https://learn.microsoft.com/en-us/windows/arm/arm64ec
75
+
76
+
77
+ ### Minject
78
+
79
+ We cannot always re-link an executable with `mimalloc.dll`, and similarly, we
80
+ cannot always ensure that the DLL comes first in the import table of the final executable.
81
+ In many cases though we can patch existing executables without any recompilation
82
+ if they are linked with the dynamic C runtime (`ucrtbase.dll`) -- just put the
83
+ `mimalloc.dll` into the import table (and put `mimalloc-redirect.dll` in the same
84
+ directory) Such patching can be done for example with [CFF Explorer](https://ntcore.com/?page_id=388).
85
+
86
+ The `minject` program can also do this from the command line
87
+ Use `minject --help` for options:
88
+
89
+ ```
90
+ > minject --help
91
+
92
+ minject:
93
+ Injects the mimalloc dll into the import table of a 64-bit executable,
94
+ and/or ensures that it comes first in het import table.
95
+
96
+ usage:
97
+ > minject [options] <exe>
98
+
99
+ options:
100
+ -h --help show this help
101
+ -v --verbose be verbose
102
+ -l --list only list imported modules
103
+ -i --inplace update the exe in-place (make sure there is a backup!)
104
+ -f --force always overwrite without prompting
105
+ --postfix=<p> use <p> as a postfix to the mimalloc dll.
106
+ e.g. use --postfix=debug to link with mimalloc-debug.dll
107
+
108
+ notes:
109
+ Without '--inplace' an injected <exe> is generated with the same name ending in '-mi'.
110
+ Ensure 'mimalloc-redirect.dll' is in the same folder as the mimalloc dll.
111
+
112
+ examples:
113
+ > minject --list myprogram.exe
114
+ > minject --force --inplace myprogram.exe
115
+ ```
116
+
117
+ For x86 32-bit binaries, use `minject32`, and for arm64 binaries use `minject-arm64`.
118
+
@@ -0,0 +1,23 @@
1
+ # This module provides function for joining paths
2
+ # known from most languages
3
+ #
4
+ # SPDX-License-Identifier: (MIT OR CC0-1.0)
5
+ # Copyright 2020 Jan Tojnar
6
+ # https://github.com/jtojnar/cmake-snips
7
+ #
8
+ # Modelled after Python’s os.path.join
9
+ # https://docs.python.org/3.7/library/os.path.html#os.path.join
10
+ # Windows not supported
11
+ function(join_paths joined_path first_path_segment)
12
+ set(temp_path "${first_path_segment}")
13
+ foreach(current_segment IN LISTS ARGN)
14
+ if(NOT ("${current_segment}" STREQUAL ""))
15
+ if(IS_ABSOLUTE "${current_segment}")
16
+ set(temp_path "${current_segment}")
17
+ else()
18
+ set(temp_path "${temp_path}/${current_segment}")
19
+ endif()
20
+ endif()
21
+ endforeach()
22
+ set(${joined_path} "${temp_path}" PARENT_SCOPE)
23
+ endfunction()
@@ -0,0 +1,19 @@
1
+ set(mi_version_major 2)
2
+ set(mi_version_minor 2)
3
+ set(mi_version_patch 5)
4
+ set(mi_version ${mi_version_major}.${mi_version_minor})
5
+
6
+ set(PACKAGE_VERSION ${mi_version})
7
+ if(PACKAGE_FIND_VERSION_MAJOR)
8
+ if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL "${mi_version_major}")
9
+ if ("${PACKAGE_FIND_VERSION_MINOR}" EQUAL "${mi_version_minor}")
10
+ set(PACKAGE_VERSION_EXACT TRUE)
11
+ elseif("${PACKAGE_FIND_VERSION_MINOR}" LESS "${mi_version_minor}")
12
+ set(PACKAGE_VERSION_COMPATIBLE TRUE)
13
+ else()
14
+ set(PACKAGE_VERSION_UNSUITABLE TRUE)
15
+ endif()
16
+ else()
17
+ set(PACKAGE_VERSION_UNSUITABLE TRUE)
18
+ endif()
19
+ endif()
@@ -0,0 +1,14 @@
1
+ include(${CMAKE_CURRENT_LIST_DIR}/mimalloc.cmake)
2
+ get_filename_component(MIMALLOC_CMAKE_DIR "${CMAKE_CURRENT_LIST_DIR}" PATH) # one up from the cmake dir, e.g. /usr/local/lib/cmake/mimalloc-2.0
3
+ get_filename_component(MIMALLOC_VERSION_DIR "${CMAKE_CURRENT_LIST_DIR}" NAME)
4
+ string(REPLACE "/lib/cmake" "/lib" MIMALLOC_LIBRARY_DIR "${MIMALLOC_CMAKE_DIR}")
5
+ if("${MIMALLOC_VERSION_DIR}" EQUAL "mimalloc")
6
+ # top level install
7
+ string(REPLACE "/lib/cmake" "/include" MIMALLOC_INCLUDE_DIR "${MIMALLOC_CMAKE_DIR}")
8
+ set(MIMALLOC_OBJECT_DIR "${MIMALLOC_LIBRARY_DIR}")
9
+ else()
10
+ # versioned
11
+ string(REPLACE "/lib/cmake/" "/include/" MIMALLOC_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}")
12
+ string(REPLACE "/lib/cmake/" "/lib/" MIMALLOC_OBJECT_DIR "${CMAKE_CURRENT_LIST_DIR}")
13
+ endif()
14
+ set(MIMALLOC_TARGET_DIR "${MIMALLOC_LIBRARY_DIR}") # legacy
@@ -0,0 +1,23 @@
1
+ # alpine image
2
+ FROM alpine
3
+
4
+ # Install tools
5
+ RUN apk add build-base make cmake
6
+ RUN apk add git
7
+ RUN apk add vim
8
+
9
+ RUN mkdir -p /home/dev
10
+ WORKDIR /home/dev
11
+
12
+ # Get mimalloc
13
+ RUN git clone https://github.com/microsoft/mimalloc -b dev2
14
+ RUN mkdir -p mimalloc/out/release
15
+ RUN mkdir -p mimalloc/out/debug
16
+
17
+ # Build mimalloc debug
18
+ WORKDIR /home/dev/mimalloc/out/debug
19
+ RUN cmake ../.. -DMI_DEBUG_FULL=ON
20
+ RUN make -j
21
+ RUN make test
22
+
23
+ CMD ["/bin/sh"]
@@ -0,0 +1,28 @@
1
+ # install from an image
2
+ # download first an appropriate tar.gz image into the current directory
3
+ # from <https://github.com/alpinelinux/docker-alpine/tree/edge/armv7>
4
+ FROM scratch
5
+
6
+ # Substitute the image name that was downloaded
7
+ ADD alpine-minirootfs-20240329-armv7.tar.gz /
8
+
9
+ # Install tools
10
+ RUN apk add build-base make cmake
11
+ RUN apk add git
12
+ RUN apk add vim
13
+
14
+ RUN mkdir -p /home/dev
15
+ WORKDIR /home/dev
16
+
17
+ # Get mimalloc
18
+ RUN git clone https://github.com/microsoft/mimalloc -b dev2
19
+ RUN mkdir -p mimalloc/out/release
20
+ RUN mkdir -p mimalloc/out/debug
21
+
22
+ # Build mimalloc debug
23
+ WORKDIR /home/dev/mimalloc/out/debug
24
+ RUN cmake ../.. -DMI_DEBUG_FULL=ON
25
+ RUN make -j
26
+ RUN make test
27
+
28
+ CMD ["/bin/sh"]
@@ -0,0 +1,28 @@
1
+ # install from an image
2
+ # download first an appropriate tar.gz image into the current directory
3
+ # from <https://github.com/alpinelinux/docker-alpine/tree/edge/x86>
4
+ FROM scratch
5
+
6
+ # Substitute the image name that was downloaded
7
+ ADD alpine-minirootfs-20250108-x86.tar.gz /
8
+
9
+ # Install tools
10
+ RUN apk add build-base make cmake
11
+ RUN apk add git
12
+ RUN apk add vim
13
+
14
+ RUN mkdir -p /home/dev
15
+ WORKDIR /home/dev
16
+
17
+ # Get mimalloc
18
+ RUN git clone https://github.com/microsoft/mimalloc -b dev2
19
+ RUN mkdir -p mimalloc/out/release
20
+ RUN mkdir -p mimalloc/out/debug
21
+
22
+ # Build mimalloc debug
23
+ WORKDIR /home/dev/mimalloc/out/debug
24
+ RUN cmake ../.. -DMI_DEBUG_FULL=ON
25
+ # RUN make -j
26
+ # RUN make test
27
+
28
+ CMD ["/bin/sh"]
@@ -0,0 +1,23 @@
1
+ FROM quay.io/pypa/manylinux2014_x86_64
2
+
3
+ # Install tools
4
+ RUN yum install -y openssl-devel
5
+ RUN yum install -y gcc gcc-c++ kernel-devel make
6
+ RUN yum install -y git cmake
7
+ RUN yum install -y vim
8
+
9
+ RUN mkdir -p /home/dev
10
+ WORKDIR /home/dev
11
+
12
+ # Get mimalloc
13
+ RUN git clone https://github.com/microsoft/mimalloc -b dev2
14
+ RUN mkdir -p mimalloc/out/release
15
+ RUN mkdir -p mimalloc/out/debug
16
+
17
+ # Build mimalloc debug
18
+ WORKDIR /home/dev/mimalloc/out/debug
19
+ RUN cmake ../.. -DMI_DEBUG_FULL=ON
20
+ RUN make -j
21
+ RUN make test
22
+
23
+ CMD ["/bin/sh"]
@@ -0,0 +1,10 @@
1
+ Various example docker files used for testing.
2
+
3
+ Usage:
4
+
5
+ ```
6
+ > cd <host>
7
+ > docker build -t <host>-mimalloc .
8
+ > docker run -it <host>-mimalloc
9
+ >> make test
10
+ ```