aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
authorTom Tromey2018-07-07 14:52:09 -0600
committerTom Tromey2018-07-12 22:12:27 -0600
commita0f2adbfc9cb1b69415f551a5e529f7e1162b9c7 (patch)
treeb6bf597a851b4ce521097802071361b7c78c4931 /src/alloc.c
parent7cb45cd25e510cf3c20adeb9ac11c0c3ea1dd340 (diff)
downloademacs-a0f2adbfc9cb1b69415f551a5e529f7e1162b9c7.tar.gz
emacs-a0f2adbfc9cb1b69415f551a5e529f7e1162b9c7.zip
Introduce the bignum type
* src/alloc.c (mark_object): Handle Lisp_Misc_Bignum. (sweep_misc): Call mpz_clear for Lisp_Misc_Bignum. * src/data.c (Ftype_of): Handle Lisp_Misc_Bignum. (Fintegerp, Finteger_or_marker_p, Fnatnump, Fnumberp) (Fnumber_or_marker_p): Update for bignum. (Ffixnump, Fbignump): New defuns. (syms_of_data): Update. * src/emacs.c (xrealloc_for_gmp, xfree_for_gmp): New functions. (main): Call mp_set_memory_functions. * src/lisp.h (enum Lisp_Misc_Type) <Lisp_Misc_Bignum>: New constant. (struct Lisp_Bignum): New. (union Lisp_Misc): Add u_bignum. (BIGNUMP, XBIGNUM, INTEGERP, NATNUMP, NUMBERP, CHECK_NUMBER) (CHECK_INTEGER, CHECK_NUMBER_COERCE_MARKER): New functions. * src/print.c (print_object): Handle Lisp_Misc_Bignum.
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 91c5152ca84..8ebf3e05d69 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -6554,6 +6554,7 @@ mark_object (Lisp_Object arg)
6554 break; 6554 break;
6555 6555
6556 case Lisp_Misc_Ptr: 6556 case Lisp_Misc_Ptr:
6557 case Lisp_Misc_Bignum:
6557 XMISCANY (obj)->gcmarkbit = true; 6558 XMISCANY (obj)->gcmarkbit = true;
6558 break; 6559 break;
6559 6560
@@ -6973,6 +6974,8 @@ sweep_misc (void)
6973 uptr->finalizer (uptr->p); 6974 uptr->finalizer (uptr->p);
6974 } 6975 }
6975#endif 6976#endif
6977 else if (mblk->markers[i].m.u_any.type == Lisp_Misc_Bignum)
6978 mpz_clear (mblk->markers[i].m.u_bignum.value);
6976 /* Set the type of the freed object to Lisp_Misc_Free. 6979 /* Set the type of the freed object to Lisp_Misc_Free.
6977 We could leave the type alone, since nobody checks it, 6980 We could leave the type alone, since nobody checks it,
6978 but this might catch bugs faster. */ 6981 but this might catch bugs faster. */