summaryrefslogtreecommitdiff
path: root/lib/final.rb
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-07-15 13:37:03 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-07-15 13:37:03 +0000
commit23dd3051c06c781b3905c993fd8fc1b3ccff6b81 (patch)
tree141b338eb698556bb47682ada965c2cd331825bb /lib/final.rb
parent3f3bcc697e989078e946ac01313d5e36cfaa3d7d (diff)
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@836 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/final.rb')
-rw-r--r--lib/final.rb39
1 files changed, 1 insertions, 38 deletions
diff --git a/lib/final.rb b/lib/final.rb
index cdffd94..9d81238 100644
--- a/lib/final.rb
+++ b/lib/final.rb
@@ -1,41 +1,4 @@
-#
# $Id$
# Copyright (C) 1998 Yukihiro Matsumoto. All rights reserved.
-# The ObjectSpace extension:
-#
-# ObjectSpace.define_finalizer(obj, proc=lambda())
-#
-# Defines the finalizer for the specified object.
-#
-# ObjectSpace.undefine_finalizer(obj)
-#
-# Removes the finalizers for the object. If multiple finalizers are
-# defined for the object, all finalizers will be removed.
-#
-
-module ObjectSpace
- Finalizers = {}
- def define_finalizer(obj, proc=lambda())
- ObjectSpace.call_finalizer(obj)
- if assoc = Finalizers[obj.id]
- assoc.push(proc)
- else
- Finalizers[obj.id] = [proc]
- end
- end
- def undefine_finalizer(obj)
- Finalizers.delete(obj.id)
- end
- module_function :define_finalizer, :undefine_finalizer
-
- Generic_Finalizer = proc {|id|
- if Finalizers.key? id
- for proc in Finalizers[id]
- proc.call(id)
- end
- Finalizers.delete(id)
- end
- }
- add_finalizer Generic_Finalizer
-end
+# final.rb is integrated into ObjectSpace; no longer needed.