From e510903d3a6209513216fcc4d4504f56f0bd9124 Mon Sep 17 00:00:00 2001 From: OEOTYAN Date: Sun, 11 Feb 2024 03:29:28 +0800 Subject: [PATCH] fix: fix hook namespace --- src/ll/api/memory/Hook.h | 2 +- src/ll/core/tweak/ModifyMemoryAllocator.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ll/api/memory/Hook.h b/src/ll/api/memory/Hook.h index cb5fe06295..5c75faeff2 100644 --- a/src/ll/api/memory/Hook.h +++ b/src/ll/api/memory/Hook.h @@ -244,7 +244,7 @@ struct __declspec(empty_bases) Hook {}; #define LL_AUTO_REG_HOOK_IMPL(FUNC_PTR, STATIC, CALL, DEF_TYPE, ...) \ LL_VA_EXPAND(LL_HOOK_IMPL( \ - inline ll::memory::HookRegistrar DEF_TYPE##AutoRegister, \ + inline ::ll::memory::HookRegistrar DEF_TYPE##AutoRegister, \ FUNC_PTR, \ STATIC, \ CALL, \ diff --git a/src/ll/core/tweak/ModifyMemoryAllocator.cpp b/src/ll/core/tweak/ModifyMemoryAllocator.cpp index 05edadc2b6..36aef67c46 100644 --- a/src/ll/core/tweak/ModifyMemoryAllocator.cpp +++ b/src/ll/core/tweak/ModifyMemoryAllocator.cpp @@ -74,7 +74,7 @@ class StdMemoryAllocator : public ::Bedrock::Memory::IMemoryAllocator { class MimallocMemoryAllocatorWithCheck : public MimallocMemoryAllocator { public: virtual void release(void* ptr) { - if (mi_is_in_heap_region(ptr)) { + if (mi_is_in_heap_region(ptr)) [[likely]] { mi_free(ptr); } else { free(ptr); @@ -84,7 +84,7 @@ class MimallocMemoryAllocatorWithCheck : public MimallocMemoryAllocator { virtual void alignedRelease(void* ptr) { release(ptr); } virtual uint64 getUsableSize(void* ptr) { - if (mi_is_in_heap_region(ptr)) { + if (mi_is_in_heap_region(ptr)) [[likely]] { return mi_usable_size(ptr); } else { return ptr ? _msize(ptr) : 0ui64; @@ -92,7 +92,7 @@ class MimallocMemoryAllocatorWithCheck : public MimallocMemoryAllocator { } virtual void* _realloc(gsl::not_null ptr, uint64 newSize) { - if (mi_is_in_heap_region(ptr)) { + if (mi_is_in_heap_region(ptr)) [[likely]] { return mi_realloc(ptr, newSize); } else { return realloc(ptr, newSize);