-/* experimental tracking of heap allocations for easy reaping no matter what the code path is
+/* Experimental tracking of heap allocations for easy reaping no matter what the code path is
+ * Copyright 2016 TJ <hacker@iam.tj>
+ * Licensed on the terms of the GNU General Public License version 3.
*
- * both tasks are in the same function to take advantage of local static variables that are
+ * Both tasks are in the same function to take advantage of local static variables that are
* persistent across calls but invisible to code outside the function.
- *
- * @param ptr NULL: calloc(nmemb, size), NULL-1: reap all, otherwise free(ptr)
- * @param nmemb number of elements of size to allocate
- * @param size size if each element
*/
#include "heap_reap.h"
size_t allocated;
};
+/*
+ * @param ptr NULL: calloc(nmemb, size), NULL-1: reap all, otherwise free(ptr)
+ * @param nmemb number of elements of size to allocate
+ * @param size size if each element
+ */
void *
heap_and_reap(void *ptr, size_t nmemb, size_t size)
{