-
-
Notifications
You must be signed in to change notification settings - Fork 904
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
FFI ruby object caching should be rewritten to not use id2ref #48
Comments
FYI, id2ref (and objectspace) is turned off by default in JRuby. We made a conscious decision to do this because it's expensive and not feasible to manage all live objects with JRuby. |
Also: tools to help implement the caching in Java/JRuby: http://java.sun.com/javase/6/docs/api/java/lang/ref/WeakReference.html Note the last item may not be exactly what is needed, it's a map w/ weak keys, not a map that weakly references its values. |
Nick, thanks for the pointers (no pun intended). |
Charlie Nutter published weakling, a library for managing weakrefs efficiently on JRuby. Check out http://github.com/tenderlove/nokogiri/tree/weakling for the branch that uses it, and https://gist.github.com/8bec624e396812c4d00e for an explanation of why it isn't in master yet. |
I think we can close this one now, can't we? |
yes. weakling branch was merged into master. |
Search for local includes in the current dir first, fixing missing error.h on clang/darwin
id2ref is slow and may be turned off by default in JRuby 1.4.
discussed with wmeissner, and the probable path is to build an API into FFI that is an hash table containing address => weakref(ruby_object).
The text was updated successfully, but these errors were encountered: