GET_STACK_TRACE_FREE;
if (UNLIKELY(IsInDlsymAllocPool(ptr)))
return;
- if (UNLIKELY(!asan_pointer_is_mine(ptr))) {
- REAL(free)(ptr);
- return;
- }
+ FORWARD_IF_MINE(free, ptr);
asan_free(ptr, &stack, FROM_MALLOC);
}
GET_STACK_TRACE_FREE;
if (UNLIKELY(IsInDlsymAllocPool(ptr)))
return;
- if (UNLIKELY(!asan_pointer_is_mine(ptr))) {
- REAL(cfree)(ptr);
- return;
- }
+ FORWARD_IF_MINE(cfree, ptr);
asan_free(ptr, &stack, FROM_MALLOC);
}
if (UNLIKELY(asan_init_is_running))
return AllocateFromLocalPool(size);
ENSURE_ASAN_INITED();
- if (UNLIKELY(!asan_pointer_is_mine(ptr))) {
- return REAL(realloc)(ptr, size);
- }
+ FORWARD_IF_MINE(realloc, ptr, size);
GET_STACK_TRACE_MALLOC;
return asan_realloc(ptr, size, &stack);
}
#else // SANITIZER_CALLS_FORWARDING
// operator delete(void*)
INTERCEPTOR(void, _ZdlPv, void *ptr) {
- MAYBE_FORWARD_TO_REAL(_ZdlPv, ptr);
+ FORWARD_IF_MINE(_ZdlPv, ptr);
OPERATOR_DELETE_BODY(FROM_NEW);
}
// operator delete[](void*)
INTERCEPTOR(void, _ZdaPv, void *ptr) {
- MAYBE_FORWARD_TO_REAL(_ZdaPv, ptr);
+ FORWARD_IF_MINE(_ZdaPv, ptr);
OPERATOR_DELETE_BODY(FROM_NEW_BR);
}
// operator delete(void*, std::nothrow_t const&)
INTERCEPTOR(void, _ZdlPvRKSt9nothrow_t, void *ptr,
std::nothrow_t const& tag) {
- MAYBE_FORWARD_TO_REAL(_ZdlPvRKSt9nothrow_t, ptr, tag);
+ FORWARD_IF_MINE(_ZdlPvRKSt9nothrow_t, ptr, tag);
OPERATOR_DELETE_BODY(FROM_NEW);
}
// operator delete[](void*, std::nothrow_t const&)
INTERCEPTOR(void, _ZdaPvRKSt9nothrow_t, void *ptr,
std::nothrow_t const& tag) {
- MAYBE_FORWARD_TO_REAL(_ZdaPvRKSt9nothrow_t, ptr, tag);
+ FORWARD_IF_MINE(_ZdaPvRKSt9nothrow_t, ptr, tag);
OPERATOR_DELETE_BODY(FROM_NEW_BR);
}
// operator delete(void*, unsigned long)
INTERCEPTOR(void, _ZdlPvm, void *ptr, size_t size) {
- MAYBE_FORWARD_TO_REAL(_ZdlPvm, ptr, size);
+ FORWARD_IF_MINE(_ZdlPvm, ptr, size);
OPERATOR_SIZED_DELETE_BODY(FROM_NEW);
}
// operator delete(void*, unsigned int)
INTERCEPTOR(void, _ZdlPvj, void *ptr, size_t size) {
- MAYBE_FORWARD_TO_REAL(_ZdlPvj, ptr, size);
+ FORWARD_IF_MINE(_ZdlPvj, ptr, size);
OPERATOR_SIZED_DELETE_BODY(FROM_NEW);
}
// operator delete[](void*, unsigned long)
INTERCEPTOR(void, _ZdaPvm, void *ptr, size_t size) {
- MAYBE_FORWARD_TO_REAL(_ZdaPvm, ptr, size);
+ FORWARD_IF_MINE(_ZdaPvm, ptr, size);
OPERATOR_SIZED_DELETE_BODY(FROM_NEW_BR);
}
// operator delete[](void*, unsigned int)
INTERCEPTOR(void, _ZdaPvj, void *ptr, size_t size) {
- MAYBE_FORWARD_TO_REAL(_ZdaPvj, ptr, size);
+ FORWARD_IF_MINE(_ZdaPvj, ptr, size);
OPERATOR_SIZED_DELETE_BODY(FROM_NEW_BR);
}
#endif