• Damien George's avatar
    py: Make it so that printing a small int does not allocate heap memory. · 88d7bba9
    Damien George authored
    With the implementation of proper string formatting, code to print a
    small int was delegated to mpz_as_str_inpl (after first converting the
    small int to an mpz using stack memory).  But mpz_as_str_inpl allocates
    heap memory to do the conversion, so small ints needed heap memory just
    to be printed.
    This fix has a separate function to print small ints, which does not
    allocate heap, and allocates less stack.
    String formatting, printf and pfenv are now large beasts, with some
    semi-duplicated code.