<dt71 <at> gmx.com> writes:

> ... 
> So new flags could be [1]:
> - realloc_flags(p, s, REALLOCF_NO_MOVE): Resize object p, without moving 
> it, to size s. With this restriction, when requesting more memory, and
> the specified amount isn't available, don't do anything (when requesting
> less memory, always succeed).
> - realloc_flags(p, s, REALLOCF_NO_MOVE | REALLOCF_ELASTIC): Resize object
> p, without moving it, to size s. With this restriction, when requesting
> more memory, and the specified amount isn't available, reserve as much as
> possible (when requesting less memory, always succeed).
> ...

The realloc_flags(), having different behavior from realloc(), should state
what happens if:

  If the pointer is a null pointer, the function does not change anything.

  If the new size is zero, the function does not change anything.

  If the new size is the same as the old size, the function does not change
  anything.

The return values have to be reviewed also.
The function returns: 
- a pointer to the object specifid on entry
- a null pointer if the object could not be modified 
- a null pointer if there was insufficient free memory available to extend 
  the size of the object

Reference to realloc():
http://www.cplusplus.com/reference/cstdlib/realloc/

jb


_______________________________________________
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Reply via email to