-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GCD and rpmalloc_thread_initialize #73
Comments
Are you using the malloc wrappers in malloc.c? The idea is that the pthread create calls should be intercepted and threads automagically initialized. |
I tried the malloc wrappers and the code crashes. I'm not sure that intercepting the pthread_create actually solves the issue when using GCD. Are you sure GCD threads are created with pthread library ? |
Can you share a minimal reproduction case for this? |
hey I also was really interested in using rpmalloc in my iOS app (Objective C++), but I also use GCD to dispatch work at will... thus can't (if the malloc wrappers are insufficient as described above). I use a lot of static queues to synchronize memory access... but all object creation happens on random queues aka I haven't tested any of this though, just exploring the idea right now. Theoretically I could and would use known/static queues to do all allocations on, if that's necessary to use rpmalloc.. once the more general problem of "will it work with GCD" is sorted out. |
You could try it out with this branch |
@dcouture2 what’s the difference? i don’t see it in the readme |
Just added a section to document the changes |
Related #63 |
Any chance you could provide a minimal reproduction of this issue? |
Ping @vitorhugomagalhaes and @victorstewart on providing more info or a reproduction case |
This should work now in latest develop branch if ENABLE_PRELOAD is set to 1 (in which case each thread will self-init when needed) |
Hi,
I'm trying to include rpmalloc into my ios project however, since we use GCD I'm not sure where to call rpmalloc_thread_initialize.
Without this call the app crashes in all the callers that are not performed in the main thread where rpmalloc_initialize was called.
Thanksm
The text was updated successfully, but these errors were encountered: