Next: system memory gmalloc, Previous: system memory core, Up: system memory [Contents][Index]
We can handle memory that must be released with the standard function free() as follows:
cce_location_t L[1];
cce_clean_handler_t P_H[1];
if (cce_location(L)) {
cce_run_catch_handlers_final(L);
} else {
void * P = cce_sys_malloc(L, 4096);
cce_init_and_register_handler_malloc(L, P_H, P);
cce_run_body_handlers(L);
}
Register H as handler in the context of L. The handler function will release the memory
block referenced by P using the standard function free().
Register H as handler in the context of L. The handler function will release the memory
block referenced by P using the standard function free().
This preprocessor macro uses _Generic to dispatch the call according to the type of the
pointer P_H; if the type is:
cce_clean_handler_tThe macro expands into a call to cce_init_and_register_clean_handler_malloc().
cce_error_handler_tThe macro expands into a call to cce_init_and_register_error_handler_malloc().
Next: system memory gmalloc, Previous: system memory core, Up: system memory [Contents][Index]
This document describes version 0.9.0-devel.3 of CCExceptions.