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:
203ca07
)
Use glib's API for memory allocation
author
espen
<espen>
Wed, 8 Oct 2008 18:11:12 +0000
(18:11 +0000)
committer
espen
<espen>
Wed, 8 Oct 2008 18:11:12 +0000
(18:11 +0000)
glib/glib.lisp
patch
|
blob
|
blame
|
history
diff --git
a/glib/glib.lisp
b/glib/glib.lisp
index c89eab14aee2d99528b2aaf92e5fc1d43e964db7..ea71c47da69425d479a80a038acd2ed61de0a86e 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.4
3 2008/04/01 21:17:59
espen Exp $
+;; $Id: glib.lisp,v 1.4
4 2008/10/08 18:11:12
espen Exp $
(in-package "GLIB")
(in-package "GLIB")
@@
-39,24
+39,20
@@
(defmacro with-mutex ((mutex) &body body)
;;;; Memory management
;;;; Memory management
-(defbinding (%allocate-memory "g_malloc0") () pointer
- (size unsigned-long))
+(deftype gsize () 'unsigned-int)
-(defbinding
(%deallocate-memory "g_free") () nil
- (
address pointer
))
+(defbinding
malloc0 () pointer
+ (
size gsize
))
-;; (setf
-;; (symbol-function 'allocate-memory) #'%allocate-memory
-;; (symbol-function 'deallocate-memory) #'%deallocate-memory)
+(defbinding free () nil
+ (address pointer))
-(setf *memory-allocator* #'
%allocate-memory
)
-(setf *memory-deallocator* #'
%deallocate-memory
)
+(setf *memory-allocator* #'
malloc0
)
+(setf *memory-deallocator* #'
free
)
(defbinding (reallocate-memory "g_realloc") () pointer
(address pointer)
(defbinding (reallocate-memory "g_realloc") () pointer
(address pointer)
- (size unsigned-long))
-
-(deftype gsize () 'unsigned-int)
+ (size gsize))
(defbinding (slice-alloc "g_slice_alloc0") () pointer
(block-size gsize))
(defbinding (slice-alloc "g_slice_alloc0") () pointer
(block-size gsize))