Permalink
Browse files

Updated README.rdoc

  • Loading branch information...
1 parent b81ead8 commit ea1000e590eaa029906a73dbee0e2c7c7464443d Paul Engel committed Jun 10, 2012
Showing with 5 additions and 3 deletions.
  1. +5 −2 README.rdoc
  2. +0 −1 lib/mass.rb
View
7 README.rdoc
@@ -144,8 +144,11 @@ Continueing with the previous example, you will get the following results:
$ foo1.object_id #=> 2164554700
$ Mass.index(Foo) #=> {"Foo"=>[2155577620, 2164554700]}
- $ Mass.detach(foo1) #=> true
- $ foo1 = nil #=> setting console variable / pointer (and thus object reference to foo1) to nil
+ # NOTE: Set foo1 to nil (within the block which only gets yielded after successfully detaching from references) as it also is a pointer to the allocated memory
+ $ Mass.detach(foo1){foo1 = nil} #=> true
+
+ # NOTE: This ensures that Mass invokes GC.start after but only after verifying that foo1 is nil pointer
+ $ Mass.gc!(foo1)
$ Mass.index(Foo) #=> {"Foo"=>[2155577620]}
View
1 lib/mass.rb
@@ -118,7 +118,6 @@ def detach!(object, *mods)
return false if object.nil?
_detach(object, mods, false).tap do |detached|
yield if detached && block_given?
- object = nil
end
end

0 comments on commit ea1000e

Please sign in to comment.