summaryrefslogtreecommitdiffstats
path: root/database/engine/journalfile.c
diff options
context:
space:
mode:
authorCosta Tsaousis <costa@netdata.cloud>2022-10-13 08:04:14 +0300
committerGitHub <noreply@github.com>2022-10-13 08:04:14 +0300
commit2974f525ec703329ef6ad079d8f6c685cfab11ad (patch)
treeb0e289a5fee787d764ee37cb8b5c2ac7bcd1bd20 /database/engine/journalfile.c
parentc805a9afad71ac96e703d599cbd6f54c29142ca7 (diff)
overload libc memory allocators with custom ones to trace all allocations (#13810)
* overload libc memory allocators with custom ones to trace all allocations * grab libc pointers for external c plugins * use -ldl when necessary; fallback to work without dlsym when it is not available * initialize global variable * add optional dl libs * dynamically link every library function when needed for the first time * prevent crashes on musl libc * another attempt * dont dereference function * attempt no 3 * attempt no 4 * cleanup - all attempts failed * dont enable tracing of allocations * missing parenthesis
Diffstat (limited to 'database/engine/journalfile.c')
-rw-r--r--database/engine/journalfile.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/database/engine/journalfile.c b/database/engine/journalfile.c
index 95c3a46f80..a79084bc92 100644
--- a/database/engine/journalfile.c
+++ b/database/engine/journalfile.c
@@ -17,7 +17,7 @@ static void flush_transaction_buffer_cb(uv_fs_t* req)
}
uv_fs_req_cleanup(req);
- free(io_descr->buf);
+ posix_memfree(io_descr->buf);
freez(io_descr);
}
@@ -225,7 +225,7 @@ int create_journal_file(struct rrdengine_journalfile *journalfile, struct rrdeng
rrd_stat_atomic_add(&global_io_errors, 1);
}
uv_fs_req_cleanup(&req);
- free(superblock);
+ posix_memfree(superblock);
if (ret < 0) {
destroy_journal_file(journalfile, datafile);
return ret;
@@ -268,7 +268,7 @@ static int check_journal_file_superblock(uv_file file)
ret = 0;
}
error:
- free(superblock);
+ posix_memfree(superblock);
return ret;
}
@@ -483,7 +483,7 @@ static uint64_t iterate_transactions(struct rrdengine_instance *ctx, struct rrde
}
skip_file:
if (unlikely(!journal_is_mmapped))
- free(buf);
+ posix_memfree(buf);
return max_id;
}