git: libc - Do some reorganization of nmalloc() and add asserts.

看板DFBSD_commit作者時間15年前 (2010/10/10 06:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
commit e58e48b4e24346fdda3691cc17bcd42522001399 Author: Matthew Dillon <dillon@apollo.backplane.com> Date: Sat Oct 9 14:47:47 2010 -0700 libc - Do some reorganization of nmalloc() and add asserts. * Reorganize mtmagazine_alloc() and mtmagazine_free() to make the code more clear. Add assertions on 'continue' loops so we abort on magazine memory corruption instead of looping forever. * Pre-stage the new magazine that mtmagazine_free() might need to avoid having to relock the depot. This also allows us to stage the new magazine directory into the per-thread loaded field instead of running it through the depot. * Fix a deep or infinite recursion which can occur when mtmagazine_free() calls _slaballoc(), which it does sometimes when it needs a new magazine. Avoid reentrancy by temporarily disabling the per-thread cache around the call. Summary of changes: lib/libc/stdlib/nmalloc.c | 169 ++++++++++++++++++++++++++------------------- 1 files changed, 99 insertions(+), 70 deletions(-) http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/e58e48b4e24346fdda3691cc17bcd42522001399 -- DragonFly BSD source repository
文章代碼(AID): #1CiErhuo (DFBSD_commit)