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

Erik Huelsmann ehuelsmann at common-lisp.net
Thu Jan 13 20:55:03 UTC 2011


Author: ehuelsmann
Date: Thu Jan 13 15:54:59 2011
New Revision: 13137

Log:
Unbreak trunk compilation. We need the specialNames after all.

Modified:
   trunk/abcl/src/org/armedbear/lisp/LispThread.java
   trunk/abcl/src/org/armedbear/lisp/SpecialBinding.java

Modified: trunk/abcl/src/org/armedbear/lisp/LispThread.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/LispThread.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/LispThread.java	Thu Jan 13 15:54:59 2011
@@ -33,6 +33,7 @@
 
 package org.armedbear.lisp;
 
+import java.lang.ref.WeakReference;
 import static org.armedbear.lisp.Lisp.*;
 
 import java.util.Iterator;
@@ -333,7 +334,10 @@
      */
     final static ConcurrentLinkedQueue<Integer> freeSpecialIndices
         = new ConcurrentLinkedQueue<Integer>();
-    
+
+    final static int specialsInitialSize
+        = Integer.valueOf(System.getProperty("abcl.specials.initialSize","4096"));
+
     /** This array stores the current special binding for every symbol
      * which has been globally or locally declared special.
      *
@@ -343,12 +347,15 @@
      * indicates an "UNBOUND VARIABLE" situation.
      */
     SpecialBinding[] specials
-        = new SpecialBinding[Integer.valueOf(System.getProperty("abcl.specials.initialSize","4096"))+1];
+        = new SpecialBinding[specialsInitialSize + 1];
+
+    final static ConcurrentHashMap<Integer, WeakReference<Symbol>> specialNames
+        = new ConcurrentHashMap<Integer, WeakReference<Symbol>>();
 
     /** The number of slots to grow the specials table in
      * case of insufficient storage.
      */
-    final int specialsDelta
+    final static int specialsDelta
         = Integer.valueOf(System.getProperty("abcl.specials.grow.delta","1024"));
 
     /** This variable points to the head of a linked list of saved

Modified: trunk/abcl/src/org/armedbear/lisp/SpecialBinding.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/SpecialBinding.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/SpecialBinding.java	Thu Jan 13 15:54:59 2011
@@ -59,7 +59,7 @@
     {
         if (value == null)
             // return or not: error doesn't return anyway
-            Lisp.error(new UnboundVariable(LispThread.specialNames[idx]));
+            Lisp.error(new UnboundVariable(LispThread.specialNames.get(new Integer(idx)).get()));
 
         return value;
     }




More information about the armedbear-cvs mailing list