Skip to content

Commit

Permalink
fix: fix hook namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
OEOTYAN committed Feb 10, 2024
1 parent f9cf73d commit e510903
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/ll/api/memory/Hook.h
Original file line number Diff line number Diff line change
Expand Up @@ -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> DEF_TYPE##AutoRegister, \
inline ::ll::memory::HookRegistrar<DEF_TYPE> DEF_TYPE##AutoRegister, \
FUNC_PTR, \
STATIC, \
CALL, \
Expand Down
6 changes: 3 additions & 3 deletions src/ll/core/tweak/ModifyMemoryAllocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -84,15 +84,15 @@ 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;
}
}

virtual void* _realloc(gsl::not_null<void*> 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);
Expand Down

0 comments on commit e510903

Please sign in to comment.