From 108b04b802df81d8166500dee3aa586b8575d40f Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 22 Apr 2015 19:54:50 -0700 Subject: 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. --- mpi/mpi.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'mpi') diff --git a/mpi/mpi.h b/mpi/mpi.h index e4a6cec2..ba255419 100644 --- a/mpi/mpi.h +++ b/mpi/mpi.h @@ -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; -- cgit v1.2.3