diff options
author | Matthias Benkard <code@mail.matthias.benkard.de> | 2007-09-16 23:12:45 +0200 |
---|---|---|
committer | Matthias Benkard <code@mail.matthias.benkard.de> | 2007-09-16 23:12:45 +0200 |
commit | 69e4519cc42f43814ae617dd2d7fb8bf06599e5c (patch) | |
tree | beeb51a291d5222317c8d93fdc25515d5ac62e42 /Lisp/constant-data.lisp | |
parent | a136324b6f1cd33a37ec902d46451e97290fa3da (diff) |
PRIMITIVE-INVOKE: Simplify memory allocation.
darcs-hash:c123cb0cf9d6d6264904dde03970cd44bb7d3a01
Diffstat (limited to 'Lisp/constant-data.lisp')
-rw-r--r-- | Lisp/constant-data.lisp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Lisp/constant-data.lisp b/Lisp/constant-data.lisp index efda456..f936908 100644 --- a/Lisp/constant-data.lisp +++ b/Lisp/constant-data.lisp @@ -1,6 +1,22 @@ (in-package #:mulk.objective-cl) +;;;; (@* "Allocation Parameters") +(defconstant +pessimistic-allocation-type+ + (loop with max-c-type = :char + for c-type in '(:pointer :int :long :float :double + #-cffi-features:no-long-long :long-long + #-cffi-features:no-long-long :unsigned-long-long + :unsigned-char :unsigned-int :unsigned-long + :short :unsigned-short) + when (> (cffi:foreign-type-size c-type) + (cffi:foreign-type-size max-c-type)) + do (progn (setq max-c-type c-type)) + finally (return max-c-type))) + +(defconstant +pessimistic-allocation-size+ + (cffi:foreign-type-size +pessimistic-allocation-type+)) + ;;;; (@* "The constant data") ;;; Copied from objc-api.h ;;; Probably ought to be generated by C code at initialisation time. |