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 3 years ago
- Status changed from In Progress to Closed
- % Done changed from 30 to 100
commit f1cdbd3731f01314c1d46f05280ad63f1770fdc6 Author: Yuri Pankov <email@example.com> Date: 2017-07-29T22:55:08.000Z 8546 want recallocarray(3C) and freezero(3C) Reviewed by: Toomas Soome <firstname.lastname@example.org> Reviewed by: Igor Kozhukhov <email@example.com> Reviewed by: Andy Stormont <firstname.lastname@example.org> Approved by: Robert Mustacchi <email@example.com>