diff options
| author | Florian Fischer <florian.fl.fischer@fau.de> | 2020-05-01 15:47:25 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fl.fischer@fau.de> | 2020-05-01 15:47:25 +0200 |
| commit | 8db3dafe61e2074c6ea51ae25aec255f361e6557 (patch) | |
| tree | 2edff6e2f2c51688d6e3e329a0448b6cde3e78b1 /src/chattymalloc.c | |
| parent | f7d8e0f2394287bfdb20a9a16494327f9de46f01 (diff) | |
| download | allocbench-8db3dafe61e2074c6ea51ae25aec255f361e6557.tar.gz allocbench-8db3dafe61e2074c6ea51ae25aec255f361e6557.zip | |
improve chattymalloc trace infrastructure
* Detect empty entries.
* Parse the trace entries using the struct python library
* fix realloc accounting
* multiple fixes in chattyparser
Diffstat (limited to 'src/chattymalloc.c')
| -rw-r--r-- | src/chattymalloc.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/chattymalloc.c b/src/chattymalloc.c index d89f531..14bde06 100644 --- a/src/chattymalloc.c +++ b/src/chattymalloc.c @@ -95,8 +95,6 @@ static void init_thread() } } - - /*========================================================= * intercepted functions */ @@ -158,11 +156,12 @@ grow_trace() static void write_trace(char func, void* ptr, size_t size, size_t var_arg) { + if (unlikely(tid == 0)) { init_thread(); } - uint64_t idx = __atomic_fetch_add (&next_entry, 1, __ATOMIC_SEQ_CST); + uint64_t idx = __atomic_fetch_add (&next_entry, 1, __ATOMIC_SEQ_CST); if (idx == total_entries - GROWTH_THRESHOLD) { grow_trace(); // wait for growth completion @@ -253,7 +252,6 @@ init() void* malloc(size_t size) { - if (next_malloc == NULL) { if (!initializing) { init(); |
