libc - Fix livelock in nmalloc
authorMatthew Dillon <dillon@apollo.backplane.com>
Sat, 9 Oct 2010 16:26:46 +0000 (09:26 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sat, 9 Oct 2010 16:26:46 +0000 (09:26 -0700)
commit4cd64cfec8d5e4d67ed8ee045e6d875a398a7892
treee08eda2fdb8d411cf4dbd0dde9699d9342a7c43c
parentaefbe905f9f9009091e0039471054d81384c78a2
libc - Fix livelock in nmalloc

* free() -> _slabfree() was turning around and calling _slaballoc()
  with the depot lock held, which could lead to a livelock.  Fix by
  unlocking the depot lock around the call.

* Clean up and document other unrelated bits of nmalloc(). In particular,
  clean up magazine_alloc().

Reported-by: Siju George <sgeorge.ml@gmail.com>, and others
lib/libc/stdlib/nmalloc.c