From c62369c0c5fc061af6f4a50d36284c63c3940912 Mon Sep 17 00:00:00 2001 From: dzaima Date: Fri, 2 Jul 2021 23:07:46 +0300 Subject: [PATCH] initialize objects a bit better 0.29% improvement --- src/opt/mm_buddyTemplate.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/opt/mm_buddyTemplate.h b/src/opt/mm_buddyTemplate.h index ee8afcf7..03f89be2 100644 --- a/src/opt/mm_buddyTemplate.h +++ b/src/opt/mm_buddyTemplate.h @@ -41,9 +41,10 @@ static void* BN(allocL)(u8 bucket, u8 type) { VALGRIND_MAKE_MEM_DEFINED(&x->mmInfo, 1); #endif allocB+= BSZ(bucket); - x->mmInfo = (x->mmInfo&0x7f) | gc_tagCurr; - x->flags = x->extra = x->type = 0; + u8 mmInfo = x->mmInfo; + x->flags = x->extra = x->type = x->mmInfo = 0; x->refc = 1; + x->mmInfo = (mmInfo&0x7f) | gc_tagCurr; x->type = type; #if defined(DEBUG) && !defined(DONT_FREE) u64* p = (u64*)x;