threaded alloc (#20492)

* allocator: catch up with multi-threading techniques
* removed the global thread lock
* more atomics for fun and profit
* added important sysAssert
* stats remain thread local and don't have to be atomic
* undo split chunk optimizations in the hope it makes the CI happy
This commit is contained in:
Andreas Rumpf 2022-10-09 11:44:02 +02:00 • committed by GitHub
commit fbc6975922
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 262 additions and 133 deletions

View file

@ -17,7 +17,7 @@ type
AtomType* = SomeNumber|pointer|ptr|char|bool
## Type Class representing valid types for use with atomic procs
when someGcc and hasThreadSupport:
when someGcc:
type AtomMemModel* = distinct cint
var ATOMIC_RELAXED* {.importc: "__ATOMIC_RELAXED", nodecl.}: AtomMemModel
@ -164,7 +164,7 @@ when someGcc and hasThreadSupport:
## ignore this parameter.
template fence*() = atomicThreadFence(ATOMIC_SEQ_CST)
elif someVcc and hasThreadSupport:
elif someVcc:
type AtomMemModel* = distinct cint
const