[PATCH] Introduce needsCleanup() for APFloat and APInt

Manuel Klimek klimek at google.com
Mon Jun 3 06:04:30 PDT 2013


Thx. Committed as r183100.


On Wed, May 29, 2013 at 9:14 AM, Chandler Carruth <chandlerc at google.com>wrote:

>
> On Tue, May 28, 2013 at 7:04 PM, Shuxin Yang <shuxin.llvm at gmail.com>wrote:
>
>> I just personally abhor the practice that promote private func
>> (especially for the fundamental data structure)
>> to public func without strong reasons.  It is just my personal taste.
>>
>
> Just for the record, I think most of us agree with you.
>
> I think the interesting difference of opinion is in what constitutes a
> "strong reason". Personally, I find the use of pool allocators with APInt
> an important use case, and others have demonstrated very serious
> performance issues with unilaterally running destructors when deallocating
> memory in some of these cases. Given these two concerns, exposing a way for
> code to avoid running destructors when safe while not leaking memory, even
> if that way is ugly, is a simple necessity of the situation we are in.
>
> I would certainly love to find a better way to use pool allocation and
> avoid undue cost of destructors that happen to be no-ops, all while
> avoiding the further exposition of internal state in the public API, but I
> have not yet found such a pattern. Until then, I think it is a reasonable
> pragmatic solution -- avoid destructors where we can, ensure we don't leak
> memory, and compromise the API in the least bad way while satisfying those
> two goals.
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130603/43b013d4/attachment.html>


More information about the llvm-commits mailing list