diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-05-08 16:27:04 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-05-08 16:27:04 +0000 |
commit | a836a244a3d2bdd4da1ee2641e3e957850668cea (patch) | |
tree | cb87c75b3677fab7144f868435243f864048a1e6 /libnetdata/onewayalloc | |
parent | Adding upstream version 1.38.1. (diff) | |
download | netdata-a836a244a3d2bdd4da1ee2641e3e957850668cea.tar.xz netdata-a836a244a3d2bdd4da1ee2641e3e957850668cea.zip |
Adding upstream version 1.39.0.upstream/1.39.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | libnetdata/onewayalloc/README.md | 4 | ||||
-rw-r--r-- | libnetdata/onewayalloc/onewayalloc.c | 9 |
2 files changed, 11 insertions, 2 deletions
diff --git a/libnetdata/onewayalloc/README.md b/libnetdata/onewayalloc/README.md index 3fa0d9fd3..38d92cea6 100644 --- a/libnetdata/onewayalloc/README.md +++ b/libnetdata/onewayalloc/README.md @@ -1,10 +1,10 @@ <!-- title: "One Way Allocator" -custom_edit_url: https://github.com/netdata/netdata/edit/master/libnetdata/onewayallocator/README.md +custom_edit_url: "https://github.com/netdata/netdata/edit/master/libnetdata/onewayalloc/README.md" sidebar_label: "One way allocator" learn_status: "Published" learn_topic_type: "Tasks" -learn_rel_path: "Developers/libnetdata libraries" +learn_rel_path: "Developers/libnetdata" --> # One Way Allocator diff --git a/libnetdata/onewayalloc/onewayalloc.c b/libnetdata/onewayalloc/onewayalloc.c index 2f007b189..489ce73d7 100644 --- a/libnetdata/onewayalloc/onewayalloc.c +++ b/libnetdata/onewayalloc/onewayalloc.c @@ -97,6 +97,10 @@ ONEWAYALLOC *onewayalloc_create(size_t size_hint) { } void *onewayalloc_mallocz(ONEWAYALLOC *owa, size_t size) { +#ifdef FSANITIZE_ADDRESS + return mallocz(size); +#endif + OWA_PAGE *head = (OWA_PAGE *)owa; OWA_PAGE *page = head->last; @@ -142,6 +146,11 @@ void *onewayalloc_memdupz(ONEWAYALLOC *owa, const void *src, size_t size) { } void onewayalloc_freez(ONEWAYALLOC *owa __maybe_unused, const void *ptr __maybe_unused) { +#ifdef FSANITIZE_ADDRESS + freez((void *)ptr); + return; +#endif + #ifdef NETDATA_INTERNAL_CHECKS // allow the caller to call us for a mallocz() allocation // so try to find it in our memory and if it is not there |