logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

CVS: sbcl/src/compiler/generic utils.lisp,1.6,1.6.4.1: msg#00084

Subject: CVS: sbcl/src/compiler/generic utils.lisp,1.6,1.6.4.1
Update of /cvsroot/sbcl/sbcl/src/compiler/generic
In directory usw-pr-cvs1:/tmp/cvs-serv26524/src/compiler/generic

Modified Files:
      Tag: backend_cleanup_1_branch
        utils.lisp 
Log Message:
0.7.7.20-backend-cleanup-1.10:
        OAOO treatment for WITH-ADJUSTABLE-VECTOR


Index: utils.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/compiler/generic/utils.lisp,v
retrieving revision 1.6
retrieving revision 1.6.4.1
diff -u -d -r1.6 -r1.6.4.1
--- utils.lisp  12 Dec 2001 18:33:42 -0000      1.6
+++ utils.lisp  13 Sep 2002 15:54:35 -0000      1.6.4.1
@@ -1,4 +1,5 @@
-;;;; utility functions needed by the back end to generate code
+;;;; utility functions and macros needed by the back end to generate
+;;;; code
 
 ;;;; This software is part of the SBCL system. See the README file for
 ;;;; more information.
@@ -58,3 +59,19 @@
        (- list-pointer-lowtag)
        (* static-fun-index (pad-data-block fdefn-size))
        (* fdefn-raw-addr-slot n-word-bytes))))
+
+;;; Various error-code generating helpers
+(defvar *adjustable-vectors* nil)
+
+(defmacro with-adjustable-vector ((var) &rest body)
+  `(let ((,var (or (pop *adjustable-vectors*)
+                   (make-array 16
+                               :element-type '(unsigned-byte 8)
+                               :fill-pointer 0
+                               :adjustable t))))
+     (declare (type (vector (unsigned-byte 8) 16) ,var))
+     (setf (fill-pointer ,var) 0)
+     (unwind-protect
+         (progn
+           ,@body)
+       (push ,var *adjustable-vectors*))))



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf


<Prev in Thread] Current Thread [Next in Thread>