part of c programming
this example uses sph-sc-lib memreg
#include#include #include "sph/memreg.c" int main(void) { memreg_init(2) int *data_a = malloc(12 * sizeof(int)) if (!data_a) goto exit memreg_add(data_a) char *data_b = malloc(20) if (!data_b) goto exit memreg_add(data_b) if (is_error) goto exit exit: memreg_free return 0 }