diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-04-22 19:54:50 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-04-22 19:54:50 -0700 |
commit | 108b04b802df81d8166500dee3aa586b8575d40f (patch) | |
tree | 507e8351d00f08a9b198b45bc5a389fd8656a942 /mpi | |
parent | 269ba9af7f0ffa9dc06b90ad590cda0671822bac (diff) | |
download | txr-108b04b802df81d8166500dee3aa586b8575d40f.tar.gz txr-108b04b802df81d8166500dee3aa586b8575d40f.tar.bz2 txr-108b04b802df81d8166500dee3aa586b8575d40f.zip |
shrink-mpi-int patch
* mpi/mpi.h (mp_int): Depending on the relative size of int and pointers,
turn the sign and alloc fields into bitfields, so that the structure
is three words wide and therefore fits into a TXR obj_t heap object.
Diffstat (limited to 'mpi')
-rw-r--r-- | mpi/mpi.h | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -72,8 +72,13 @@ #define MAX_RADIX 64 typedef struct { +#if SIZEOF_INT >= SIZEOF_PTR + unsigned int sign : 1; + unsigned int alloc : sizeof(int)*CHAR_BIT - 1; +#else mp_sign sign; /* sign of this quantity */ mp_size alloc; /* how many digits allocated */ +#endif mp_size used; /* how many digits used */ mp_digit *dp; /* the digits themselves */ } mp_int; |