Skip to content

Commit

Permalink
address review: comment
Browse files Browse the repository at this point in the history
  • Loading branch information
skirpichev committed Jan 24, 2025
1 parent 336e881 commit e658f2b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Modules/_decimal/_decimal.c
Original file line number Diff line number Diff line change
Expand Up @@ -3689,6 +3689,11 @@ dec_as_long(PyObject *dec, PyObject *context, int round)
assert(layout->digit_size == 2 || layout->digit_size == 4);

uint32_t base = (uint32_t)1 << layout->bits_per_digit;
/* We use a temporary buffer for digits for now, as for nonzero rdata
mpd_qexport_u32/u16() require either space "allocated by one of
libmpdec’s allocation functions" or "rlen MUST be correct" (to avoid
reallocation). This can be further optimized by using rlen from
mpd_sizeinbase(). See gh-127925. */
void *tmp_digits = NULL;
size_t n;

Expand Down

0 comments on commit e658f2b

Please sign in to comment.