summaryrefslogtreecommitdiffstats
path: root/libnetdata/aral/aral.c
diff options
context:
space:
mode:
Diffstat (limited to 'libnetdata/aral/aral.c')
-rw-r--r--libnetdata/aral/aral.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/libnetdata/aral/aral.c b/libnetdata/aral/aral.c
index 4505ee0f2..60fe5e39a 100644
--- a/libnetdata/aral/aral.c
+++ b/libnetdata/aral/aral.c
@@ -465,6 +465,9 @@ static inline ARAL_PAGE *aral_acquire_a_free_slot(ARAL *ar TRACE_ALLOCATIONS_FUN
}
void *aral_mallocz_internal(ARAL *ar TRACE_ALLOCATIONS_FUNCTION_DEFINITION_PARAMS) {
+#ifdef FSANITIZE_ADDRESS
+ return mallocz(ar->config.requested_element_size);
+#endif
ARAL_PAGE *page = aral_acquire_a_free_slot(ar TRACE_ALLOCATIONS_FUNCTION_CALL_PARAMS);
@@ -614,6 +617,11 @@ static inline void aral_move_page_with_free_list___aral_lock_needed(ARAL *ar, AR
}
void aral_freez_internal(ARAL *ar, void *ptr TRACE_ALLOCATIONS_FUNCTION_DEFINITION_PARAMS) {
+#ifdef FSANITIZE_ADDRESS
+ freez(ptr);
+ return;
+#endif
+
if(unlikely(!ptr)) return;
// get the page pointer
@@ -877,10 +885,10 @@ void aral_by_size_release(ARAL *ar) {
fatal("ARAL BY SIZE: double release detected");
aral_by_size_globals.array[size].refcount--;
- if(!aral_by_size_globals.array[size].refcount) {
- aral_destroy(aral_by_size_globals.array[size].ar);
- aral_by_size_globals.array[size].ar = NULL;
- }
+// if(!aral_by_size_globals.array[size].refcount) {
+// aral_destroy(aral_by_size_globals.array[size].ar);
+// aral_by_size_globals.array[size].ar = NULL;
+// }
netdata_spinlock_unlock(&aral_by_size_globals.spinlock);
}