summaryrefslogtreecommitdiff
path: root/Lisp/internal-utilities.lisp
diff options
context:
space:
mode:
authorMatthias Benkard <code@mail.matthias.benkard.de>2008-02-17 12:41:52 +0100
committerMatthias Benkard <code@mail.matthias.benkard.de>2008-02-17 12:41:52 +0100
commit0c4aa479a72e2c41f775b5874e6d14b986a3c8a8 (patch)
treef13e2fbb99caf7cfbc8d62148bde48b646128bdf /Lisp/internal-utilities.lisp
parent9518f18560285cbeb66269a0cd88e7ff6146aee9 (diff)
Improve the WITH-FOREIGN-STRING-POOL macro.
darcs-hash:368ae035198c23f02565826576535eca63088985
Diffstat (limited to 'Lisp/internal-utilities.lisp')
-rw-r--r--Lisp/internal-utilities.lisp12
1 files changed, 8 insertions, 4 deletions
diff --git a/Lisp/internal-utilities.lisp b/Lisp/internal-utilities.lisp
index 92b003b..b23905f 100644
--- a/Lisp/internal-utilities.lisp
+++ b/Lisp/internal-utilities.lisp
@@ -50,12 +50,16 @@
(member symbol *features*))
-(defmacro with-foreign-string-pool ((register-fn-name) &body body)
+(defmacro with-foreign-string-pool ((register-fn-name
+ allocate-fn-name) &body body)
(let ((pool-var (gensym)))
`(let ((,pool-var (list)))
- (flet ((,register-fn-name (x)
- (push x ,pool-var)
- x))
+ (labels ((,register-fn-name (x)
+ (push x ,pool-var)
+ x)
+ (,allocate-fn-name (string)
+ (,register-fn-name
+ (cffi:foreign-string-alloc string))))
(unwind-protect
(progn ,@body)
(dolist (x ,pool-var)