summaryrefslogtreecommitdiff
path: root/libguile/strings.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2011-10-24 17:58:22 +0200
committerAndy Wingo <wingo@pobox.com>2011-10-24 18:54:04 +0200
commit21041372ed4a3c837f6d16149648508d49b4b2e2 (patch)
tree77121f605195cc7effb3874c6df583bf9df5dc55 /libguile/strings.c
parentdc7da0be90d6033d512f9772894179970af678e7 (diff)
downloadguile-21041372ed4a3c837f6d16149648508d49b4b2e2.tar.gz
add SCM_{PACK,UNPACK}_POINTER
* libguile/tags.h (SCM_UNPACK_POINTER, SCM_PACK_POINTER): New macros. The old SCM2PTR and PTR2SCM were defined in such a way that round-tripping through a pointer could lose precision, even in the case in which you weren't interested in actually dereferencing the pointer, it was simply that you needed to plumb a SCM through APIs that take pointers. These new macros are more like SCM_PACK and SCM_UNPACK, but for pointer types. The bit representation of the pointer should be the same as the scm_t_bits representation. * libguile/gc.h (PTR2SCM, SCM2PTR): Remove support for (old) UNICOS pointers. We are going to try tagging the SCM object itself in the future, and I don't think that keeping this support is worth its cost. It probably doesn't work anyway. * libguile/backtrace.c: * libguile/bytevectors.c: * libguile/continuations.c: * libguile/fluids.c: * libguile/foreign.c: * libguile/gc.h: * libguile/guardians.c: * libguile/hashtab.c: * libguile/load.c: * libguile/numbers.c: * libguile/ports.c: * libguile/smob.c: * libguile/strings.c: * libguile/symbols.c: * libguile/vm.c: * libguile/weak-set.c: * libguile/weak-table.c: * libguile/weak-vector.c: Update many sites to use the new macros.
Diffstat (limited to 'libguile/strings.c')
-rw-r--r--libguile/strings.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libguile/strings.c b/libguile/strings.c
index d3c8e155c..d3490a930 100644
--- a/libguile/strings.c
+++ b/libguile/strings.c
@@ -126,7 +126,7 @@ make_stringbuf (size_t len)
lenhist[1000]++;
#endif
- buf = PTR2SCM (scm_gc_malloc_pointerless (STRINGBUF_HEADER_BYTES + len + 1,
+ buf = SCM_PACK_POINTER (scm_gc_malloc_pointerless (STRINGBUF_HEADER_BYTES + len + 1,
"string"));
SCM_SET_CELL_TYPE (buf, STRINGBUF_TAG);
@@ -153,7 +153,7 @@ make_wide_stringbuf (size_t len)
#endif
raw_len = (len + 1) * sizeof (scm_t_wchar);
- buf = PTR2SCM (scm_gc_malloc_pointerless (STRINGBUF_HEADER_BYTES + raw_len,
+ buf = SCM_PACK_POINTER (scm_gc_malloc_pointerless (STRINGBUF_HEADER_BYTES + raw_len,
"string"));
SCM_SET_CELL_TYPE (buf, STRINGBUF_TAG | STRINGBUF_F_WIDE);