[armedbear-cvs] r13249 - trunk/abcl/src/org/armedbear/lisp

Erik Huelsmann ehuelsmann at common-lisp.net
Sun Mar 13 10:17:13 UTC 2011


Author: ehuelsmann
Date: Sun Mar 13 06:17:10 2011
New Revision: 13249

Log:
Revert r13248, "Close #138 by implementing finalizers on LispObject."
since it breaks trunk building.

Modified:
   trunk/abcl/src/org/armedbear/lisp/Autoload.java
   trunk/abcl/src/org/armedbear/lisp/LispObject.java
   trunk/abcl/src/org/armedbear/lisp/Primitives.java

Modified: trunk/abcl/src/org/armedbear/lisp/Autoload.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Autoload.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/Autoload.java	Sun Mar 13 06:17:10 2011
@@ -519,8 +519,6 @@
         autoload(PACKAGE_EXT, "string-position", "StringFunctions");
         autoload(PACKAGE_EXT, "make-weak-reference", "WeakReference", true);
         autoload(PACKAGE_EXT, "weak-reference-value", "WeakReference", true);
-        autoload(PACKAGE_EXT, "finalize", "Primitives", true);
-        autoload(PACKAGE_EXT, "cancel-finalization", "Primitives", true);
         autoload(PACKAGE_JAVA, "%jnew-proxy", "JProxy");
         autoload(PACKAGE_JAVA, "%find-java-class", "JavaObject");
         autoload(PACKAGE_JAVA, "%register-java-class", "JavaObject");

Modified: trunk/abcl/src/org/armedbear/lisp/LispObject.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/LispObject.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/LispObject.java	Sun Mar 13 06:17:10 2011
@@ -1284,25 +1284,4 @@
   public void incrementHotCount()
   {
   }
-
-  private Cons finalizers = null;
-
-  synchronized public void addFinalizer(LispObject fun) {
-      finalizers = new Cons(fun, finalizers);
-  }
-
-  synchronized public void cancelFinalizers() {
-      finalizers = null;
-  }
-
-  @Override
-  @SuppressWarnings("FinalizeDeclaration")
-  protected void finalize()
-    throws Throwable {
-      while (finalizers != null) {
-          finalizers.car.execute();
-          finalizers = (Cons)finalizers.cdr;
-      }
-      super.finalize();
-  }
 }

Modified: trunk/abcl/src/org/armedbear/lisp/Primitives.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Primitives.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/Primitives.java	Sun Mar 13 06:17:10 2011
@@ -2,7 +2,6 @@
  * Primitives.java
  *
  * Copyright (C) 2002-2007 Peter Graves
- * Copyright (C) 2011 Erik Huelsmann
  * $Id$
  *
  * This program is free software; you can redistribute it and/or
@@ -5819,34 +5818,4 @@
         }
     };
 
-    // ### finalize
-    private static final Primitive FINALIZE
-        = new pf_finalize();
-    private static final class pf_finalize extends Primitive {
-        pf_finalize() {
-            super("finalize", PACKAGE_EXT, true, "object function");
-        }
-
-        @Override
-        public LispObject execute(LispObject obj, LispObject fun) {
-            obj.addFinalizer(fun);
-            return obj;
-        }
-    };
-
-    // ### cancel-finalization
-    private static final Primitive CANCEL_FINALIZATION
-        = new pf_cancel_finalization();
-    private static final class pf_cancel_finalization extends Primitive {
-        pf_cancel_finalization() {
-            super("cancel-finalization", PACKAGE_EXT, true, "object");
-        }
-
-        @Override
-        public LispObject execute(LispObject obj) {
-            obj.cancelFinalizers();
-            return obj;
-        }
-    };
-
 }




More information about the armedbear-cvs mailing list