diff options
Diffstat (limited to 'usr.sbin/nsd/region-allocator.h')
-rw-r--r-- | usr.sbin/nsd/region-allocator.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/usr.sbin/nsd/region-allocator.h b/usr.sbin/nsd/region-allocator.h index 7a7bfe96f2a..d525a2b05bc 100644 --- a/usr.sbin/nsd/region-allocator.h +++ b/usr.sbin/nsd/region-allocator.h @@ -88,6 +88,8 @@ void region_remove_cleanup(region_type *region, */ void *region_alloc(region_type *region, size_t size); +/** Allocate array with integer overflow checks, in region */ +void *region_alloc_array(region_type *region, size_t num, size_t size); /* * Allocate SIZE bytes of memory inside REGION and copy INIT into it. @@ -96,6 +98,12 @@ void *region_alloc(region_type *region, size_t size); */ void *region_alloc_init(region_type *region, const void *init, size_t size); +/** + * Allocate array (with integer overflow check on sizes), and init with + * the given array copied into it. Allocated in the region + */ +void *region_alloc_array_init(region_type *region, const void *init, + size_t num, size_t size); /* * Allocate SIZE bytes of memory inside REGION that are initialized to @@ -104,6 +112,11 @@ void *region_alloc_init(region_type *region, const void *init, size_t size); */ void *region_alloc_zero(region_type *region, size_t size); +/** + * Allocate array (with integer overflow check on sizes), and zero it. + * Allocated in the region. + */ +void *region_alloc_array_zero(region_type *region, size_t num, size_t size); /* * Run the cleanup actions and free all memory associated with REGION. |