[PATCH 3/9] gmp-utils: New API to simply use of GMP's integer/rational/float objects
Tom Tromey
tromey@adacore.com
Fri Nov 13 15:04:15 GMT 2020
>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:
>> There would need to be methods for arithmetic operations that we use
>> (e.g. mpz_add), but we don't have to add methods for all existing
>> functions in gmp, just the ones we use. And I presume we don't use that
>> many.
Joel> I'm not sure about that. The main purpose of these classes is to automate
Joel> the lifetime of the data allocated when creating the underlying GMP objects.
Joel> Beyond that, there are a few help routines that are connected as methods
Joel> because it makes sense to do so now that we have the classes, but could
Joel> have otherwise been just regular functions.
I tend to think we should just leave it for now. My main reason is that
the patches already exist & are tested in this form; and there are
follow-up patches to post as well. And, it's taken quite a long while
to find the necessary time to prep these for submission.
Also perhaps instead of updating these we should reconsider using the
c++ classes that come with gmp. See gmpxx.h or
(info "(gmp) C++ Class Interface")
(I'm don't recall why these weren't used, maybe it's the caveat in the
manual. However I think we can probably deal with that ok.)
Anyway, I'm happy to do either of these as follow-ups after landing.
Unlike prepping the patches, this kind of work can readily be done in
spare moments.
Let me know if this plan is alright with you.
>> Is this meant to be "operator="?
Joel> Nice catch! I think so, and I'll fix if Tom confirms as well.
Yeah, oops.
Tom
More information about the Gdb-patches
mailing list