[PATCH] D32299: [scudo] Remove GetActuallyAllocatedSize calls from the fast path

Kostya Kortchinsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 20 09:38:05 PDT 2017


cryptoad created this revision.

GetActuallyAllocatedSize is actually expensive. In order to avoid calling this
function in the malloc/free fast path, we change the Scudo chunk header to
store the size of the chunk, if from the Primary, or the amount of unused
bytes if from the Secondary. This way, we only have to call the culprit
function for Secondary backed allocations (and still in realloc).

The performance gain on a singly threaded pure malloc/free benchmark exercising
the Primary allocator is above 5%.


https://reviews.llvm.org/D32299

Files:
  lib/scudo/scudo_allocator.cpp
  lib/scudo/scudo_allocator.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32299.95973.patch
Type: text/x-patch
Size: 7328 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170420/e6a406cf/attachment.bin>


More information about the llvm-commits mailing list