summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libguile/objcodes.c11
-rw-r--r--libguile/objcodes.h3
2 files changed, 8 insertions, 6 deletions
diff --git a/libguile/objcodes.c b/libguile/objcodes.c
index 1c3c525f2..b7aa578ed 100644
--- a/libguile/objcodes.c
+++ b/libguile/objcodes.c
@@ -45,11 +45,11 @@ verify (((sizeof (SCM_OBJCODE_COOKIE) - 1) & 7) == 0);
*/
/* The words in an objcode SCM object are as follows:
- - scm_tc7_objcode | the flags for this objcode
+ - scm_tc7_objcode | type | flags
- the struct scm_objcode C object
- - the parent of this objcode, if this is a slice, or #f if none
- - the file descriptor this objcode came from if this was mmaped,
- or 0 if none
+ - the parent of this objcode: either another objcode, a bytevector,
+ or, in the case of mmap types, file descriptors (as an inum)
+ - "native code" -- not currently used.
*/
static SCM
@@ -100,8 +100,7 @@ make_objcode_by_mmap (int fd)
sret = scm_double_cell (SCM_MAKE_OBJCODE_TAG (SCM_OBJCODE_TYPE_MMAP, 0),
(scm_t_bits)(addr + strlen (SCM_OBJCODE_COOKIE)),
- SCM_UNPACK (SCM_BOOL_F),
- (scm_t_bits)fd);
+ SCM_UNPACK (scm_from_int (fd)), 0);
/* FIXME: we leak ourselves and the file descriptor. but then again so does
dlopen(). */
diff --git a/libguile/objcodes.h b/libguile/objcodes.h
index 36f3ea902..2fc43d5ed 100644
--- a/libguile/objcodes.h
+++ b/libguile/objcodes.h
@@ -57,6 +57,9 @@ struct scm_objcode
#define SCM_OBJCODE_IS_SLICE(x) (SCM_OBJCODE_TYPE (x) == SCM_OBJCODE_TYPE_SLICE)
#define SCM_OBJCODE_IS_STATIC(x) (SCM_OBJCODE_TYPE (x) == SCM_OBJCODE_TYPE_STATIC)
+#define SCM_OBJCODE_NATIVE_CODE(x) (SCM_CELL_WORD_3 (x))
+#define SCM_SET_OBJCODE_NATIVE_CODE(x, code) (SCM_SET_CELL_WORD_3 (x, code))
+
SCM scm_c_make_objcode_slice (SCM parent, const scm_t_uint8 *ptr);
SCM_API SCM scm_load_objcode (SCM file);
SCM_API SCM scm_objcode_p (SCM obj);