diff options
author | Andy Wingo <wingo@pobox.com> | 2018-04-10 19:54:58 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2018-04-10 20:01:52 +0200 |
commit | 41689edfc31dd7e0438d776754d550311a878ce5 (patch) | |
tree | b29857c08a1f32d83ee7857c7534c73d91685708 /module/system/base/types.scm | |
parent | b9f7621e132873f9aa2dc198e1f428f959ce93ab (diff) | |
download | guile-41689edfc31dd7e0438d776754d550311a878ce5.tar.gz |
Slim heap-allocated flonums
* libguile/numbers.h (struct scm_t_double, struct scm_t_complex): Avoid
adding an extra padding word on systems with 8-byte pointers.
* module/system/base/types.scm (cell->object): Update to compute correct
offset of embedded double.
Diffstat (limited to 'module/system/base/types.scm')
-rw-r--r-- | module/system/base/types.scm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/module/system/base/types.scm b/module/system/base/types.scm index c6aaed242..834fa5f38 100644 --- a/module/system/base/types.scm +++ b/module/system/base/types.scm @@ -1,5 +1,5 @@ ;;; 'SCM' type tag decoding. -;;; Copyright (C) 2014, 2015, 2017 Free Software Foundation, Inc. +;;; Copyright (C) 2014, 2015, 2017, 2018 Free Software Foundation, Inc. ;;; ;;; This library is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU Lesser General Public License as published by @@ -419,7 +419,7 @@ using BACKEND." (((_ & #xffff = %tc16-bignum)) (inferior-object 'bignum address)) (((_ & #xffff = %tc16-flonum) pad) - (let* ((address (+ address (* 2 %word-size))) + (let* ((address (+ address (match %word-size (4 8) (8 8)))) (port (memory-port backend address (sizeof double))) (words (get-bytevector-n port (sizeof double)))) (bytevector-ieee-double-ref words 0 (native-endianness)))) |