summaryrefslogtreecommitdiff
path: root/libguile/objcodes.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2011-01-27 13:11:02 +0100
committerAndy Wingo <wingo@pobox.com>2011-01-27 13:11:02 +0100
commit6ce3666ff2a8f73a6abab17535dc27051f8ab8b6 (patch)
tree8d8e35e367d8740011b2cbb37336125e5d868510 /libguile/objcodes.c
parentf9654187b1ff0e20dfcb66da963eae62f4d03be1 (diff)
downloadguile-6ce3666ff2a8f73a6abab17535dc27051f8ab8b6.tar.gz
for mmap objcodes, store the fd in the third word, as a scheme int
This leaves space for native code. * libguile/objcodes.h (SCM_OBJCODE_NATIVE_CODE) (SCM_SET_OBJCODE_NATIVE_CODE): Reserve the fourth word of objcode for "native code", whatever that means. * libguile/objcodes.c: Update a comment. (make_objcode_by_mmap): Put the fd in the third word.
Diffstat (limited to 'libguile/objcodes.c')
-rw-r--r--libguile/objcodes.c11
1 files changed, 5 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(). */