In Perl_safesys{c,m,re}alloc(), defer dTHX for non-DEBUGING builds.
authorNicholas Clark <nick@ccl4.org>
Tue, 15 Jun 2010 20:26:14 +0000 (21:26 +0100)
committerNicholas Clark <nick@ccl4.org>
Tue, 15 Jun 2010 20:26:14 +0000 (21:26 +0100)
commit0cb20dae370512c655eb665a7d5089db2819e862
tree33747b3944efa7c0128c27524932ab1ec89715e1
parent0a18a49b281a5a76e75de77e45ee27ad1b807bb2
In Perl_safesys{c,m,re}alloc(), defer dTHX for non-DEBUGING builds.

Under ithreads, dTHX expands to pthread_getspecific() [or something similarly
expensive], which the compiler can't optimise away. However, its return value
isn't needed unless the allocation fails. So defer the call, hence avoiding
it entirely on a successful allocation.

DEBUGING builds require the value of dTHX for debugging purposes, so we can't
postpone it for them. Unthreaded builds were never affected as they don't use
thread local storage for the interpreter context.
util.c