Skip to content
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

$LOADED_FEATURES.clear does not appear to clear internal set #413

Closed
headius opened this issue Nov 26, 2012 · 4 comments
Closed

$LOADED_FEATURES.clear does not appear to clear internal set #413

headius opened this issue Nov 26, 2012 · 4 comments

Comments

@headius
Copy link
Member

@headius headius commented Nov 26, 2012

We have an internal set in the $LOADED_FEATURES array that allows include? and friends to be O(1) complexity. However, it seems like it's not being cleared properly for some of the Array methods like #clear:

system ~/projects/jruby $ jruby -Itmp -e 'puts require "nothing"; $LOADED_FEATURES.clear; puts require "nothing"'
in nothing
true
false

system ~/projects/jruby $ ruby-1.9.3 -Itmp -e 'puts require "nothing"; $LOADED_FEATURES.clear; puts require "nothing"'
in nothing
true
in nothing
true
@shepmaster
Copy link
Contributor

@shepmaster shepmaster commented Dec 29, 2012

You addressed this in 10e6ea3, but reverted it in c325605 and then filed this issue. However, if I apply the first patch you had, your test case works:

$ touch /tmp/nothing.rb
$ ./bin/jruby -I/tmp -e 'puts require "nothing"; $LOADED_FEATURES.clear; puts require "nothing"'
true
true

What was the "Something's not right here" that caused you to revert?

@headius
Copy link
Member Author

@headius headius commented Apr 5, 2016

This is still valid in JRuby 9.1 and should be fixed.

@kares
Copy link
Member

@kares kares commented Apr 8, 2016

this seems to be working (on master) now after: f147a5e + e00bf50 ... need a similar fix on jruby-1_7

kares added a commit to kares/jruby that referenced this issue Jan 20, 2017
since this special array uses an internal set for speed

resolves jruby#413
kares added a commit to kares/jruby that referenced this issue Jan 20, 2017
@kares kares self-assigned this Jan 20, 2017
@kares kares added this to the JRuby 9.1.8.0 milestone Jan 20, 2017
@kares kares closed this in 43cc895 Jan 20, 2017
@kares
Copy link
Member

@kares kares commented Jan 20, 2017

wasn't fixed in the end - also needed some test tuning as some of the tests influenced others.
not sure about the backport for jruby-1_7 ... no one complained but its probably a good idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.