Project

General

Profile

Feature #8546

want recallocarray(3C) and freezero(3C)

Added by Yuri Pankov over 2 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
lib - userland libraries
Start date:
2017-07-28
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:

Description

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.

History

#1

Updated by Electric Monk over 2 years ago

  • % Done changed from 30 to 100
  • Status changed from In Progress to Closed

git commit f1cdbd3731f01314c1d46f05280ad63f1770fdc6

commit  f1cdbd3731f01314c1d46f05280ad63f1770fdc6
Author: Yuri Pankov <yuri.pankov@nexenta.com>
Date:   2017-07-29T22:55:08.000Z

    8546 want recallocarray(3C) and freezero(3C)
    Reviewed by: Toomas Soome <tsoome@me.com>
    Reviewed by: Igor Kozhukhov <igor@dilos.org>
    Reviewed by: Andy Stormont <astormont@racktopsystems.com>
    Approved by: Robert Mustacchi <rm@joyent.com>

Also available in: Atom PDF