Thread (7 messages) 7 messages, 2 authors, 2021-10-09

should free() refer to posix_memalign?

From: Jonny Grant <hidden>
Date: 2021-10-08 11:19:47

Hello

https://man7.org/linux/man-pages/man3/malloc.3.html

"The free() function frees the memory space pointed to by ptr,
 which must have been returned by a previous call to malloc(),
 calloc(), or realloc().  "


Could this list refer to the other ways memory can be allocated too? free() accepts other memory.
posix_memalign
aligned_alloc
memalign
valloc
pvalloc
reallocarray

That would be changing it to say :-

"The free() function frees the memory space pointed to by ptr,
 which must have been returned by a previous call to malloc(),
 calloc(), realloc(), posix_memalign(), aligned_alloc(), memalign(), valloc(), reallocarray() or pvalloc()"

https://man7.org/linux/man-pages/man3/posix_memalign.3.html

Kind regards
Jonny
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help