diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2021-01-14 19:43:30 -0800 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2021-01-14 19:43:30 -0800 |
| commit | 2c43d65c7db47f2b682b8924669b8e6aef22ec0a (patch) | |
| tree | 54eef343d568fa5272b9114fab2d40c197076ae8 /bp.c | |
| parent | 3cd61e3abc79a80d38afa9c633c59585aeb0311a (diff) | |
Made all the heap garbage collection code optional, which saves some
time and memory.
Diffstat (limited to 'bp.c')
| -rw-r--r-- | bp.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -120,7 +120,9 @@ static int process_file(def_t *defs, const char *filename, vm_op_t *pattern, uns } recycle_if_unused(&m); +#ifdef DEBUG_HEAP check(recycle_all_matches() == 0, "Memory leak: there should no longer be any matches in use at this point."); +#endif destroy_file(&f); return success; @@ -300,7 +302,7 @@ int main(int argc, char *argv[]) } if (flags & BP_JSON) printf("]\n"); -#ifdef FREE_ON_EXIT +#ifdef DEBUG_HEAP // This code frees up all residual heap-allocated memory. Since the program // is about to exit, this step is unnecessary. However, it is useful for // tracking down memory leaks. |
