What two kinds?
For the usual Math::MPFR objects, destruction is conducted as follows:
void DESTROY(mpfr_t * p) {
mpfr_clear(*p);
Safefree(p);
}
For this slightly different "kind" that I was hoping to introduce, it needs to be:
void DESTROY(mpfr_t * p) {
Safefree(p);
}
This is because, with the latter "kind", there's no dynamically allocated space for mpfr_clear() to clean up - and attempting to do so, simply causes a segfault.
My main difficulty is that, for both "kinds", the Devel::Peek::Dump() is essentially the same - which leads me to now think that blessing both "kinds" into the same package is a no-go. Initially, I thought I could make use of the TEMP flag - but that's a blind alley that grew out of a poorly designed test script (rather than an XY problem :-)
If I had realised sooner just what the TEMP flag implied, I would have understood that it had nothing to offer me and my post would have been quite different ... possibly would not have come to fruition.
Basically, DESTROY() needs to be able to determine whether or not to invoke the mpfr_clear() call - and my problem is that I don't see how it can make that decision, simply because the means to distinguish one "kind" from the other doesn't exist.
The idea is probably headed for the scrap heap .... the value of what I was thinking of doing has only *limited* value in a perl context, anyway.
Cheers,
Rob
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.