From 74cc85038e5685aa7f9e81e0a9004b0717fb22a5 Mon Sep 17 00:00:00 2001 From: Dirk Herrmann Date: Tue, 26 Sep 2000 20:11:22 +0000 Subject: * Don't use string or vector macros when accessing compiled closures. --- libguile/procs.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'libguile/procs.h') diff --git a/libguile/procs.h b/libguile/procs.h index 942385d7d..0a3de0374 100644 --- a/libguile/procs.h +++ b/libguile/procs.h @@ -74,7 +74,17 @@ typedef struct #define SCM_SUBRF(x) ((SCM (*)()) SCM_CELL_WORD_1 (x)) #define SCM_SET_SUBRF(x, v) (SCM_SET_CELL_WORD_1 ((x), (v))) #define SCM_DSUBRF(x) ((double (*)()) SCM_CELL_WORD_1 (x)) -#define SCM_CCLO_SUBR(x) (SCM_VELTS(x)[0]) + +#define SCM_CCLO_LENGTH(x) (SCM_CELL_WORD_0 (x) >> 8) +#define SCM_SET_CCLO_LENGTH(x, v) (SCM_SET_CELL_WORD_0 ((x), ((v) << 8) + scm_tc7_cclo)) +#define SCM_CCLO_BASE(x) ((scm_bits_t *) SCM_CELL_WORD_1 (x)) +#define SCM_SET_CCLO_BASE(x, v) (SCM_SET_CELL_WORD_1 ((x), (v))) + +#define SCM_CCLO_REF(x, i) (SCM_PACK (SCM_CCLO_BASE (x) [i])) +#define SCM_CCLO_SET(x, i, v) (SCM_CCLO_BASE (x) [i] = SCM_UNPACK (v)) + +#define SCM_CCLO_SUBR(x) (SCM_CCLO_REF ((x), 0)) +#define SCM_SET_CCLO_SUBR(x, v) (SCM_CCLO_SET ((x), 0, (v))) #define SCM_SUBR_GENERIC(x) (SCM_SUBR_ENTRY (x).generic) #define SCM_SUBR_PROPS(x) (SCM_SUBR_ENTRY (x).properties) -- cgit v1.2.3