[libc-commits] [PATCH] D121350: [libc] Add a resizable container with constexpr constructor and destructor.

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed Mar 9 19:02:34 PST 2022


sivachandra created this revision.
sivachandra added reviewers: abrachet, michaelrj, lntue.
Herald added subscribers: libc-commits, ecnelises, tschuett, mgorny.
Herald added projects: libc-project, All.
sivachandra requested review of this revision.

Explicitly marking a destructor with `constexpr` is a c++20 feature but
making the destructor a NOP essentially makes it a `constexpr`. The
optimization levels should be increased to actually get the constexpr
behavior though.

The new container is used to store atexit callbacks. This way, we avoid
the possibility of the destructor of the container itself getting added
as at exit callback.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D121350

Files:
  libc/src/__support/CPP/CMakeLists.txt
  libc/src/__support/CPP/blobstore.h
  libc/src/stdlib/CMakeLists.txt
  libc/src/stdlib/atexit.cpp
  libc/src/stdlib/exit.cpp
  libc/test/src/__support/CPP/CMakeLists.txt
  libc/test/src/__support/CPP/blobstore_test.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D121350.414265.patch
Type: text/x-patch
Size: 10281 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20220310/d569ecc3/attachment-0001.bin>


More information about the libc-commits mailing list