in reply to Re^11: Puzzled by value of $overload::ops{binary}
in thread Puzzled by value of $overload::ops{binary}
If the C functions you wrote and then let Inline::C do its stuff with take/return SVs, I'd suggest that's a category error, and they should instead take/return mpz_t values (or pointers thereto). With the right typemap entries, you could just write XS functions that take/return mpz_t values, and omit the Inline::C stuff, which isn't as necessary as you might think, once you have all the typemap, CODE: and OUTPUT: stuff working, which you evidently do.
Having had a very quick look at https://github.com/sisyphus/math-gmpz/blob/master/typemap, is there a reason all those identical "types" aren't just the one? If you gave an OUTPUT clause as well, that would significantly facilitate the idea above. PDL's typemap can be used as a quite good template.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^13: Puzzled by value of $overload::ops{binary}
by syphilis (Archbishop) on Jun 28, 2024 at 11:41 UTC | |
by etj (Priest) on Jun 30, 2024 at 11:00 UTC | |
by syphilis (Archbishop) on Jun 30, 2024 at 12:00 UTC |