shared/specifier: use realloc to free some memory after specifier expansion
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 28 Mar 2018 08:33:40 +0000 (10:33 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 28 Mar 2018 08:38:45 +0000 (10:38 +0200)
commitbec8a68ceee4cbf5de4d7026e750f11130c33ccd
tree055982c52eddf65486e752fe77c4b4385fa39fc4
parente2093454a248ff7d879077a77f4e9a086439d353
shared/specifier: use realloc to free some memory after specifier expansion

This is a separate commit only because it actually *increases* memory allocations:
==3256==   total heap usage: 100,120 allocs, 100,120 frees, 13,097,140 bytes allocated
to
==4690==   total heap usage: 100,121 allocs, 100,121 frees, 14,198,329 bytes allocated

Essentially, we do a little more work to reduce the memory footprint a bit. For a
test where we just allocate the memory and drop it soon afterwards, this is not
beneficial, but it should still be useful for a long running program.
src/shared/specifier.c