From: Jim Cromie Date: Sun, 10 Jul 2005 15:59:30 +0000 (-0600) Subject: [patch: sv.c] reuse new_body_inline in Perl_new_body X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=30f9da9e3831971d9eed035728db462f81862e51;p=p5sagit%2Fp5-mst-13.2.git [patch: sv.c] reuse new_body_inline in Perl_new_body Message-ID: <42D19A42.8040409@divsol.com> p4raw-id: //depot/perl@25113 --- diff --git a/sv.c b/sv.c index 99e456e..0687df1 100644 --- a/sv.c +++ b/sv.c @@ -1112,18 +1112,7 @@ S_more_bodies (pTHX_ void **arena_root, void **root, size_t size) /* grab a new thing from the free list, allocating more if necessary */ -STATIC void * -S_new_body(pTHX_ void **arena_root, void **root, size_t size) -{ - void *xpv; - LOCK_SV_MUTEX; - xpv = *root ? *root : S_more_bodies(aTHX_ arena_root, root, size); - *root = *(void**)xpv; - UNLOCK_SV_MUTEX; - return xpv; -} - -/* and an inline version */ +/* 1st, the inline version */ #define new_body_inline(xpv, arena_root, root, size) \ STMT_START { \ @@ -1134,6 +1123,16 @@ S_new_body(pTHX_ void **arena_root, void **root, size_t size) UNLOCK_SV_MUTEX; \ } STMT_END +/* now use the inline version in the proper function */ + +STATIC void * +S_new_body(pTHX_ void **arena_root, void **root, size_t size) +{ + void *xpv; + new_body_inline(xpv, arena_root, root, size); + return xpv; +} + /* return a thing to the free list */ #define del_body(thing, root) \