Closed disteph closed 4 years ago
Here's just a ping on this PR: our usage of ctypes-zarith in our project has not changed since commit 67f6ab0 a month ago; it works well and I consider it stable. There shouldn't be any more PR or commit on this. As we would like to release version 1.0 of our project on opam, is there a chance you would merge this PR and push it to opam as well, so that we can have ctypes-zarith as an opam dependency?
Sorry, I don't have the time to review it. I will just merge it and release it.
Thanks!
By experimenting with the bindings I realised I need the 3 lower-level functions (clear, init_set, and the handler). That's because in C functions manipulating GMP integers, you can find arrays of mpz integers, and these are not arrays of pointers but 2-dimensional arrays (because mpz_t is not a pointer but a 1-cell array). Hence, in order to feed the following C function (from my use case)
the current interface of ctypes-zarith was not sufficient: we need to allocate a contiguous array of mpz (and calling
MPZ.make()
one integer at a time doesn't make them contiguous). Hence the use to access the handler forMPZ.t abstract
,clear
, andinit_set
for doing an n-ary allocation and filling the cells.