[libc-commits] [libc] [libc] Add aligned_alloc (PR #96586)

Nick Desaulniers via libc-commits libc-commits at lists.llvm.org
Tue Jun 25 09:02:00 PDT 2024


================
@@ -111,6 +113,24 @@ bool FreeList<NUM_BUCKETS>::add_chunk(span<cpp::byte> chunk) {
   return true;
 }
 
+template <size_t NUM_BUCKETS>
+template <typename Cond>
+span<cpp::byte> FreeList<NUM_BUCKETS>::find_chunk_if(Cond op) const {
+  for (size_t i = 0; i < chunks_.size(); ++i) {
----------------
nickdesaulniers wrote:

Or even a range-for?

https://github.com/llvm/llvm-project/pull/96586


More information about the libc-commits mailing list