[Patch] Use uintptr_t instead of ptr comparisons in BumpPtrAllocator (Was: Re: [llvm] r215841 - BumpPtrAllocator: remove 'no slabs allocated yet' check)

Chandler Carruth chandlerc at google.com
Wed Sep 3 10:51:12 PDT 2014

On Wed, Sep 3, 2014 at 9:56 AM, Hans Wennborg <hans at chromium.org> wrote:

> On Wed, Sep 3, 2014 at 9:47 AM, Chandler Carruth <chandlerc at google.com>
> wrote:
> > As long as 'alignAddr' can move a pointer more than one past the end of
> the
> > allocation, it doesn't really work IMO. But this is all such a
> technicality,
> > I'm not sure how much continued hacking is worth here.
> I'm not sure I'm following here. alignAddr doesn't work with a
> pointer, it's just rounding up a uintptr_t. Are you concerned about
> comparing that uintptr_t to another uintptr_t?

Ok, so it may be wrapping but isn't hitting UB. And the difference is
defined and correct even if wrapped.... OK, sure.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140903/11adaa1e/attachment.html>

More information about the llvm-commits mailing list