Call overhead does appear to be showing up on our profiles.
Change-Id: If3875a8972769f45282e0eb1d4aef6324cd56878
Reviewed-on: https://skia-review.googlesource.com/17833
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
this->installPtrFooter(NextBlock, previousDtor, 0);
}
-char* SkArenaAlloc::allocObject(uint32_t size, uint32_t alignment) {
- uintptr_t mask = alignment - 1;
- char* objStart = (char*)((uintptr_t)(fCursor + mask) & ~mask);
- if ((ptrdiff_t)size > fEnd - objStart) {
- this->ensureSpace(size, alignment);
- objStart = (char*)((uintptr_t)(fCursor + mask) & ~mask);
- }
- return objStart;
-}
-
char* SkArenaAlloc::allocObjectWithFooter(uint32_t sizeIncludingFooter, uint32_t alignment) {
uintptr_t mask = alignment - 1;
void ensureSpace(uint32_t size, uint32_t alignment);
- char* allocObject(uint32_t size, uint32_t alignment);
+ char* allocObject(uint32_t size, uint32_t alignment) {
+ uintptr_t mask = alignment - 1;
+ char* objStart = (char*)((uintptr_t)(fCursor + mask) & ~mask);
+ if ((ptrdiff_t)size > fEnd - objStart) {
+ this->ensureSpace(size, alignment);
+ objStart = (char*)((uintptr_t)(fCursor + mask) & ~mask);
+ }
+ return objStart;
+ }
char* allocObjectWithFooter(uint32_t sizeIncludingFooter, uint32_t alignment);