Changeset 13249 for trunk/abcl/src/org


Ignore:
Timestamp:
03/13/11 10:17:10 (10 years ago)
Author:
ehuelsmann
Message:

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

Location:
trunk/abcl/src/org/armedbear/lisp
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/Autoload.java

    r13248 r13249  
    520520        autoload(PACKAGE_EXT, "make-weak-reference", "WeakReference", true);
    521521        autoload(PACKAGE_EXT, "weak-reference-value", "WeakReference", true);
    522         autoload(PACKAGE_EXT, "finalize", "Primitives", true);
    523         autoload(PACKAGE_EXT, "cancel-finalization", "Primitives", true);
    524522        autoload(PACKAGE_JAVA, "%jnew-proxy", "JProxy");
    525523        autoload(PACKAGE_JAVA, "%find-java-class", "JavaObject");
  • trunk/abcl/src/org/armedbear/lisp/LispObject.java

    r13248 r13249  
    12851285  {
    12861286  }
    1287 
    1288   private Cons finalizers = null;
    1289 
    1290   synchronized public void addFinalizer(LispObject fun) {
    1291       finalizers = new Cons(fun, finalizers);
    1292   }
    1293 
    1294   synchronized public void cancelFinalizers() {
    1295       finalizers = null;
    1296   }
    1297 
    1298   @Override
    1299   @SuppressWarnings("FinalizeDeclaration")
    1300   protected void finalize()
    1301     throws Throwable {
    1302       while (finalizers != null) {
    1303           finalizers.car.execute();
    1304           finalizers = (Cons)finalizers.cdr;
    1305       }
    1306       super.finalize();
    1307   }
    13081287}
  • trunk/abcl/src/org/armedbear/lisp/Primitives.java

    r13248 r13249  
    33 *
    44 * Copyright (C) 2002-2007 Peter Graves
    5  * Copyright (C) 2011 Erik Huelsmann
    65 * $Id$
    76 *
     
    58205819    };
    58215820
    5822     // ### finalize
    5823     private static final Primitive FINALIZE
    5824         = new pf_finalize();
    5825     private static final class pf_finalize extends Primitive {
    5826         pf_finalize() {
    5827             super("finalize", PACKAGE_EXT, true, "object function");
    5828         }
    5829 
    5830         @Override
    5831         public LispObject execute(LispObject obj, LispObject fun) {
    5832             obj.addFinalizer(fun);
    5833             return obj;
    5834         }
    5835     };
    5836 
    5837     // ### cancel-finalization
    5838     private static final Primitive CANCEL_FINALIZATION
    5839         = new pf_cancel_finalization();
    5840     private static final class pf_cancel_finalization extends Primitive {
    5841         pf_cancel_finalization() {
    5842             super("cancel-finalization", PACKAGE_EXT, true, "object");
    5843         }
    5844 
    5845         @Override
    5846         public LispObject execute(LispObject obj) {
    5847             obj.cancelFinalizers();
    5848             return obj;
    5849         }
    5850     };
    5851 
    58525821}
Note: See TracChangeset for help on using the changeset viewer.