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

Add recursion_guard_outer() for use in hashing mutable objects. #811

Merged
merged 4 commits into from
Mar 4, 2017

Conversation

jerith
Copy link
Contributor

@jerith jerith commented Jul 20, 2013

This is an updated PR to replace #460.

@@ -16,4 +16,29 @@ def abort_on_exception=(value)
def abort_on_exception
@abort_on_exception ||= (Thread.abort_on_exception || false)
end

def recursion_guard_outer(identifier, obj, &block)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldnt' be exposed on the public Thread object.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thread.recursion_guard is already exposed, unless there's some magic that limits the visibility of methods implemented in rpython. We need to call this from recursive methods on Array and Hash, so it needs to be visible there at least.

@@ -1,4 +1,28 @@
module Topaz
def self.recursion_guard_outer(identifier, obj, &block)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're moving stuff anyway, I think we should have all recursion_guard methods on Topaz (or Topaz::Thread, I don't really mind). But with this, we have Topaz.recursion_guard_outer and Thread#recursion_guard - there just shouldn't be two places for this.

@timfel timfel merged commit e80bb2c into topazproject:master Mar 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants