Make pass-by-reference explicit by using pointer
commita1e44f0ffd6c35dd905f2ce24b4bde5a8e3108fc
authorMichael Kruse <isl@meinersbur.de>
Tue, 30 Jun 2015 14:59:45 +0000 (30 16:59 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Wed, 1 Jul 2015 08:01:46 +0000 (1 10:01 +0200)
tree881b830d26181f4d5f5e814d3ad827dd8af963e3
parent3e4de51855e70b8331d7831a4f9542231d60d539
Make pass-by-reference explicit by using pointer

GMP's mpz_t automatically decays to pointer and IMath's mp_int is a
pointer, therefore changing them in a function body always also changes
the argument of the function's caller.  With an isl_int implementation
without pointer semantics (as in imath-32) this is not the case and
the value change is not visible outside of the function.

The parameter t of function row_cmp is allocated and free'd by its
caller, hence we pass a pointer to its location instead the value
itself. Otherwise, the value may get promoted to a big representation
inside the function and the memory allocated in that conversion would
not get freed, resulting in a memory leak.

8528f07 (Make pass-by-reference explicit by using pointers,
Tue May 26 15:02:33 2015 +0200) fixed the same issue in
the function isl_int_gcdext.

Signed-off-by: Michael Kruse <isl@meinersbur.de>
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_tab.c