[libcxx-commits] [PATCH] D112168: [libc++]Use __libcpp_malloc/__libcpp_calloc in places of malloc/calloc

Xing Xue via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Oct 21 14:40:08 PDT 2021


xingxue added a comment.

In D112168#3079369 <https://reviews.llvm.org/D112168#3079369>, @ldionne wrote:

> I don't understand the problem statement. Doesn't `malloc` and `calloc` always align stuff at 16 bytes? https://godbolt.org/z/oor5KaedP

The `malloc` and `calloc` of the `AIX` `libc` do not always align at 16 bytes.

  $ cat malloc.c
  #include <stdlib.h>
  #include <stdio.h>
  
  int main()
  {
    char *ptr=malloc(8);
    char *vec_ptr=vec_malloc(8);
    printf("ptr=0x%p, vec_ptr=0x%p\n", ptr, vec_ptr);
  }
  $ xlc malloc.c
  $ a.out
  ptr=0x200005b8, vec_ptr=0x200005d0


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112168



More information about the libcxx-commits mailing list