Skip to content

Checked array allocation arithmetic with isc_mem_get and friends

Ondřej Surý requested to merge ondrej-isc_mem_cget into main

Add new isc_mem_cget(), isc_mem_creget(), and isc_mem_cput() macros to complement the isc_mem_callocate() (which works like calloc()).

The overflow checks are implemented as macros in the <isc/mem.h>, so that the compiler can see that the element size is constant: it should always be sizeof(something).

Merge request reports