-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Use LibC.malloc instead of GC.malloc for LibPCRE allocations #12456
Use LibC.malloc instead of GC.malloc for LibPCRE allocations #12456
Conversation
|
It seems the CI failure here is real. There seems to be some kind of infinite recursion during a GC cycle. No idea why. |
We should probably undo this and the other one for 1.6 |
It's only a problem in the interpreter, right? So we could just undo it there. |
Aah... maybe interpreting |
I think the problematic line is this: LibPCRE.free.call @re.as(Void*) It seems that if you print what's I'll see if I can fix this. |
I don't think I'll be able to fix this for 1.6 so it might be better to either undo this for 1.6, or conditionally do this depending on whether this runs in interpreted mode or not. |
This is a workaround for an interpreter bug (crystal-lang#12495) and basically restores the status before crystal-lang#12456.
Follow-up on #12451.
This makes the memory management os LibPCRE manual for the stdlib. So any internal allocations are made with the system allocator, leaving less memory being managed by the GC.
Public interface is unchanged.
As an adicional benefit: libpcre doesn't need to be linked anymore if the program doesn't create any regex!