Open michaeleiselsc opened 7 years ago
I see, I can still have #import "jemalloc.h"
at the top of my file, but once I declare any function using a JEMalloc function, e.g.:
void myFunc()
{
je_malloc(2);
}
I get the error.
Hmm I see that my target was strange in that case, so I had the target match the host and be arm-apple-darwin10
. It still encounters the same problem, though.
@michaeleiselsc Did you manage to figure out how to build on iOS?
Still no luck
We don't have the ability to test on iOS, so I think we likely won't be able to debug this on our end. I think the next step would be to look into why the allocation is failing, with a debugger (preferably building at the head of dev).
This appears to have been fixed by 498856f44a30b31fe713a18eb2fc7c6ecf3a9f63.
Cool! I'll give it another look then
ignoring file src/zone.pic.o, file was built for unsupported file format ( 0xCF 0xFA 0xED 0xFE 0x0C 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x01 0x00 0x00 0x00 ) which is not the architecture being linked (x86_64): src/zone.pic.o
Undefined symbols for architecture x86_64:
"_je_free", referenced from:
operator delete(void*) in jemalloc_cpp.pic.o
operator delete[](void*) in jemalloc_cpp.pic.o
operator delete(void*, std::nothrow_t const&) in jemalloc_cpp.pic.o
operator delete[](void*, std::nothrow_t const&) in jemalloc_cpp.pic.o
"_je_malloc", referenced from:
operator new(unsigned long) in jemalloc_cpp.pic.o
operator new[](unsigned long) in jemalloc_cpp.pic.o
operator new(unsigned long, std::nothrow_t const&) in jemalloc_cpp.pic.o
operator new[](unsigned long, std::nothrow_t const&) in jemalloc_cpp.pic.o
handleOOM(unsigned long, bool) in jemalloc_cpp.pic.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [lib/libjemalloc.2.dylib] Error 1
what is this error ,when i run make
@xionghengheng that's because that file wasn't built for an iphone architecture, so the linker ignores it. see my comment in https://github.com/jemalloc/jemalloc/issues/1138 for help. @michaelfairley jemalloc seems to be working now on ios, i believe we can close this
I've built it with:
When I run JEMalloc, I get an error with the following stack trace:
And it simply prints
<jemalloc>: Error allocating TSD for
Any ideas what might be wrong? Thanks.