summaryrefslogtreecommitdiff
path: root/mpz/bin_ui.c
diff options
context:
space:
mode:
authorMarco Bodrato <bodrato@mail.dm.unipi.it>2015-11-09 22:30:52 +0100
committerMarco Bodrato <bodrato@mail.dm.unipi.it>2015-11-09 22:30:52 +0100
commit7acd63c08b3b969696681ee8125ea63e543998c8 (patch)
treefccdc23ceb50b4647ac4dd5848c9170972c3030d /mpz/bin_ui.c
parente97517c73c6a962a9d2cd519adcc639087cd1a75 (diff)
downloadgmp-7acd63c08b3b969696681ee8125ea63e543998c8.tar.gz
mpz: Lazy allocation.
Diffstat (limited to 'mpz/bin_ui.c')
-rw-r--r--mpz/bin_ui.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mpz/bin_ui.c b/mpz/bin_ui.c
index c24b21724..bc5894510 100644
--- a/mpz/bin_ui.c
+++ b/mpz/bin_ui.c
@@ -83,7 +83,7 @@ mpz_bin_ui (mpz_ptr r, mpz_srcptr n, unsigned long int k)
/* Now wanting bin(ni+k,k), with ni positive, and "negate" is the sign (0
for positive, 1 for negative). */
- SIZ (r) = 1; PTR (r)[0] = 1;
+ SIZ (r) = 1; MPZ_NEWALLOC (r, 1)[0] = 1;
/* Rewrite bin(n,k) as bin(n,n-k) if that is smaller. In this case it's
whether ni+k-k < k meaning ni<k, and if so change to denominator ni+k-k