From 8c16e68dda72032e81a624360b1abb1006e33481 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Wed, 29 Apr 2020 23:24:30 +0000 Subject: Correct alloc.h documentation --- doc/libstddjb/alloc.html | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'doc/libstddjb/alloc.html') diff --git a/doc/libstddjb/alloc.html b/doc/libstddjb/alloc.html index 87b1751..ca6ecf1 100644 --- a/doc/libstddjb/alloc.html +++ b/doc/libstddjb/alloc.html @@ -65,11 +65,10 @@ should favor them over basic interfaces like malloc().

Functions

- char *alloc (size_t len)
+ void *alloc (size_t len)
Allocates a block of len bytes in the heap and returns a pointer -to the start of the block (or NULL if it failed). Though the pointer type -is char *, the block of memory is correctly aligned for any type -of object. If len is 0, the function returns a pointer that +to the start of the block (or NULL if it failed). +If len is 0, the function returns a unique pointer that cannot be written to, but that is not null. Note that this is different from the required C99 behaviour for malloc().

@@ -85,7 +84,9 @@ Redimension the block of heap memory pointed to by *p to newlen bytes. The block may have to be moved, in which case *p will be modified. Normally returns 1; if an error occurred, returns 0 and sets errno, and neither *p nor its contents are -modified. +modified. Note that p must be a pointer to a char *, +because polymorphism isn't possible here (for reasons that have to do +with pointer representation in C).

-- cgit v1.2.3