#include <malloc.h> -- Xcode
23,830
If you just need to use malloc
then you can grab it from the stdlib like so:
#include <stdlib.h>
Otherwise, you can directly call malloc.h
like so:
#include <malloc/malloc.h>
EDIT:
A posix_memalign()
exists in stdlib.h
. The implementation looks like:
int posix_memalign(void **, size_t, size_t);
Perhaps you can make an alias to this and use it?
Author by
Ryan
Updated on May 09, 2020Comments
-
Ryan about 4 years
I have an interesting problem where I can't include malloc.h in my project.
I need malloc.h for Paul Nettle's mmgr tool (I'm not keen on using instruments)
Problem is I can't find the system library for memalign.
Xcode keeps failing because it cannot this definition & neither can I.
Anyone else seen this?!
-
Ryan about 13 yearsIts not malloc I need. Its memalign.
-
Ryan about 13 yearsIve tried including both of the above & neither contains a prototype for memalign
-
KushalP about 13 yearsYou could remap it to use posix_memalign. See my edit to the question.