Speedup for guarded allocator

- Re-arrange locks, so no actual memory allocation
  (which is relatively slow) happens from inside
  the lock. operation system will take care of locks
  which might be needed there on it's own.

- Use spin lock instead of mutex, since it's just
  list operations happens from inside lock, no need
  in mutex here.

- Use atomic operations for memory in use and total
  used blocks counters.

This makes guarded allocator almost the same speed
as non-guarded one in files from Tube project.

There're still MemHead/MemTail overhead which might
be bad for CPU cache utilization
This commit is contained in:
2013-08-19 10:51:40 +00:00
parent efa836531e
commit c0f8e15295
12 changed files with 42 additions and 32 deletions

View File

@@ -36,6 +36,7 @@ incs = [
'.',
'./intern',
'#/intern/guardedalloc',
'#/intern/atomic',
'#/intern/memutil',
'#/extern/glew/include',
'#/intern/audaspace/intern',