summaryrefslogtreecommitdiff
path: root/Lisp/constant-data.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'Lisp/constant-data.lisp')
-rw-r--r--Lisp/constant-data.lisp16
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.