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?!
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?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With