[libcxx-commits] [PATCH] D123511: [libc++abi] Fix fallback allocator alignment issue

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Apr 13 10:41:03 PDT 2022


ldionne added inline comments.


================
Comment at: libcxxabi/src/fallback_malloc.cpp:76-77
+
+typedef half_size_uint<sizeof(void*)>::type heap_offset;
+typedef half_size_uint<sizeof(void*)>::type heap_size;
 
----------------
miyuki wrote:
> ldionne wrote:
> > This is perhaps silly, but I'm not sure I understand why changing the representation of the offset and size is what we want to do here. Shouldn't we instead be adjusting the pointer we are returning when we allocate memory to have the proper alignment?
> > 
> > In other words, this patch has the side effect that we'll return properly aligned memory, however we could technically keep the same representation as before and also return aligned memory, right?
> Right. I found an existing patch that seems to do the right thing: https://reviews.llvm.org/D12669. Should we revive it?
Very interesting! Yes, I would definitely support reviving that patch!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123511/new/

https://reviews.llvm.org/D123511



More information about the libcxx-commits mailing list