diff options
author | Nick Bofferding <bofferdn@us.ibm.com> | 2016-06-01 14:36:44 -0500 |
---|---|---|
committer | William G. Hoffa <wghoffa@us.ibm.com> | 2016-06-06 12:53:09 -0400 |
commit | d7ee93594674f6321985f4b248d67eccb2e631af (patch) | |
tree | e65f12789b1862fa016a9c4de6ee7a3530dabaa5 /src/kernel | |
parent | 316efae763177df278d42590482fd8a00a56d63c (diff) | |
download | talos-hostboot-d7ee93594674f6321985f4b248d67eccb2e631af.tar.gz talos-hostboot-d7ee93594674f6321985f4b248d67eccb2e631af.zip |
Support transition from small to big allocation in realloc
Change-Id: I16cb187d12834c74e8682fb84d26d09b7f98869a
CQ: SW354768
Backport: master-p8
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/25271
Tested-by: Jenkins Server
Reviewed-by: Christopher J. Engel <cjengel@us.ibm.com>
Tested-by: FSP CI Jenkins
Reviewed-by: A. P. Williams III <iawillia@us.ibm.com>
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Diffstat (limited to 'src/kernel')
-rw-r--r-- | src/kernel/heapmgr.C | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/kernel/heapmgr.C b/src/kernel/heapmgr.C index e27eb2bb1..69cd2663f 100644 --- a/src/kernel/heapmgr.C +++ b/src/kernel/heapmgr.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2010,2015 */ +/* Contributors Listed Below - COPYRIGHT 2010,2016 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -138,7 +138,8 @@ void* HeapManager::_realloc(void* i_ptr, size_t i_sz) size_t asize = bucketByteSize(chunk->bucket)-8; if(asize < i_sz) { - new_ptr = _allocate(i_sz); + new_ptr = (i_sz > MAX_SMALL_ALLOC_SIZE) ? + _allocateBig(i_sz) : _allocate(i_sz); memcpy(new_ptr, i_ptr, asize); _free(i_ptr); } |