diff options
author | Nicholas Clark <nick@ccl4.org> | 2005-07-02 13:07:26 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2005-07-02 13:07:26 +0000 |
commit | 77354fb48907e3618a62531aa2e90772ef4375d9 (patch) | |
tree | e0d266e831c4ff7e4dd2ce0c7429e0e44744e193 /sv.c | |
parent | 9320a0378277d341c9c126313f5ba5a16b26450d (diff) | |
download | perl-77354fb48907e3618a62531aa2e90772ef4375d9.tar.gz |
Don't inline offer_nice_chunk, as it's rarely called.
p4raw-id: //depot/perl@25047
Diffstat (limited to 'sv.c')
-rw-r--r-- | sv.c | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -165,6 +165,27 @@ Public API: * "A time to plant, and a time to uproot what was planted..." */ +/* + * nice_chunk and nice_chunk size need to be set + * and queried under the protection of sv_mutex + */ +void +Perl_offer_nice_chunk(pTHX_ void *chunk, U32 chunk_size) +{ + void *new_chunk; + U32 new_chunk_size; + LOCK_SV_MUTEX; + new_chunk = (void *)(chunk); + new_chunk_size = (chunk_size); + if (new_chunk_size > PL_nice_chunk_size) { + Safefree(PL_nice_chunk); + PL_nice_chunk = (char *) new_chunk; + PL_nice_chunk_size = new_chunk_size; + } else { + Safefree(chunk); + } + UNLOCK_SV_MUTEX; +} #ifdef DEBUG_LEAKING_SCALARS # ifdef NETWARE |