Index: /branches/objc-gf/ccl/lib/foreign-types.lisp
===================================================================
--- /branches/objc-gf/ccl/lib/foreign-types.lisp	(revision 6042)
+++ /branches/objc-gf/ccl/lib/foreign-types.lisp	(revision 6043)
@@ -71,5 +71,6 @@
   (ordinal-lock (make-lock))
   (ordinal-types (make-hash-table :test #'eq :weak :key))
-  (pointer-types (make-hash-table :test #'equalp)))
+  (pointer-types (make-hash-table :test #'equalp))
+  (array-types (make-hash-table :test #'equalp)))
 
 
@@ -1711,14 +1712,19 @@
             (error "Dimension is not a non-negative fixnum: ~S" loser))))
 	
-      (let ((type (parse-foreign-type ele-type)))
-        (make-foreign-array-type
-         :element-type type
-         :dimensions dims
-         :alignment (foreign-type-alignment type)
-         :bits (if (and (ensure-foreign-type-bits type)
-                        (every #'integerp dims))
-                 (* (align-offset (foreign-type-bits type)
-                                  (foreign-type-alignment type))
-                    (reduce #'* dims))))))
+      (let* ((type (parse-foreign-type ele-type))
+            (pair (cons type dims)))
+        (declare (dynamic-extent pair))
+        (or (gethash pair (ftd-array-types *target-ftd*))
+            (setf (gethash (cons type dims) (ftd-array-types *target-ftd*))
+                  
+                  (make-foreign-array-type
+                   :element-type type
+                   :dimensions dims
+                   :alignment (foreign-type-alignment type)
+                   :bits (if (and (ensure-foreign-type-bits type)
+                                  (every #'integerp dims))
+                           (* (align-offset (foreign-type-bits type)
+                                            (foreign-type-alignment type))
+                              (reduce #'* dims))))))))
     (def-foreign-type-translator * (to)
       (let* ((to (if (eq to t) *void-foreign-type* (parse-foreign-type to))))
