• Marius Gerbershagen's avatar
    bignums: don't use ecl_alloc_atomic for gmp · c301b108
    Marius Gerbershagen authored
    The gmp manual (https://gmplib.org/manual/Custom-Allocation.html) states
    > GMP may use allocated blocks to hold pointers to other allocated
      blocks. This will limit the assumptions a conservative garbage
      collection scheme can make.
    Thus we can't use ecl_alloc_atomic. We could just use ecl_alloc
    instead, however our implementation is already structured in such a
    way that it is sufficient to use ecl_alloc_uncollectable. The reason
    for that is that currently all bignums except those in the bignum
    registers in the thread local environment are allocated as compact
    objects so that we only need to call mpz_clear for the few non-compact
    objects in the bignum registers.
    See also commits 7b536161 and bd48b859.
    Fixes #485.
external.h 121 KB