want recallocarray(3C) and freezero(3C)
lib - userland libraries
another openbsd compatibility functions:
The recallocarray() function is similar to reallocarray() except it ensures newly allocated memory is cleared similar to calloc(). If ptr is NULL, oldnmemb is ignored and the call is equivalent to calloc(). If ptr is not NULL, oldnmemb must be a value such that oldnmemb * size is the size of the earlier allocation that returned ptr, otherwise the behaviour is undefined. The freezero() function is similar to the free() function except it ensures memory is explicitly discarded. If ptr is NULL, no action occurs. If ptr is not NULL, the size argument must be equal or smaller than the size of the earlier allocation that returned ptr. freezero() guarantees the memory range starting at ptr with length size is discarded while deallocating the whole object originally allocated.
Updated by Electric Monk over 2 years ago
- % Done changed from 30 to 100
- Status changed from In Progress to Closed
commit f1cdbd3731f01314c1d46f05280ad63f1770fdc6 Author: Yuri Pankov <firstname.lastname@example.org> Date: 2017-07-29T22:55:08.000Z 8546 want recallocarray(3C) and freezero(3C) Reviewed by: Toomas Soome <email@example.com> Reviewed by: Igor Kozhukhov <firstname.lastname@example.org> Reviewed by: Andy Stormont <email@example.com> Approved by: Robert Mustacchi <firstname.lastname@example.org>