chiark
/
gitweb
/
~mdw
/
clg
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a115157
)
Added macro WITH-ALLOCATED-MEMORY
author
espen
<espen>
Thu, 9 Feb 2006 22:24:31 +0000
(22:24 +0000)
committer
espen
<espen>
Thu, 9 Feb 2006 22:24:31 +0000
(22:24 +0000)
glib/glib.lisp
patch
|
blob
|
blame
|
history
diff --git
a/glib/glib.lisp
b/glib/glib.lisp
index d5c68568cb8314dc673a5e96515286e50b7dd205..ebc3b30f1ff3e7127fe156467486253883d9397e 100644
(file)
--- a/
glib/glib.lisp
+++ b/
glib/glib.lisp
@@
-20,7
+20,7
@@
;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-;; $Id: glib.lisp,v 1.3
2 2006/02/06 18:12:19
espen Exp $
+;; $Id: glib.lisp,v 1.3
3 2006/02/09 22:24:31
espen Exp $
(in-package "GLIB")
(in-package "GLIB")
@@
-47,6
+47,12
@@
(defun copy-memory (from length &optional (to (allocate-memory length)))
#+sbcl(system-area-ub8-copy from 0 to 0 length)
to)
#+sbcl(system-area-ub8-copy from 0 to 0 length)
to)
+(defmacro with-allocated-memory ((var size) &body body)
+ `(let ((,var (allocate-memory ,size)))
+ (unwind-protect
+ (progn ,@body)
+ (deallocate-memory ,var))))
+
;;;; User data mechanism
;;;; User data mechanism