[libcxx-commits] [PATCH] D146815: [ASan][libc++] Annotating std::deque with all allocators

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jul 17 15:17:03 PDT 2023


ldionne accepted this revision.
ldionne added a comment.
This revision is now accepted and ready to land.

LGTM after comments are applied.



================
Comment at: libcxx/test/libcxx/containers/sequences/deque/asan_turning_off.pass.cpp:19
+
+#include <assert.h>
+#include <stdlib.h>
----------------
Please use `<cassert>` instead.

`<stdlib.h>` shouldn't be necessary after my comments below.


================
Comment at: libcxx/test/libcxx/containers/sequences/deque/asan_turning_off.pass.cpp:28
+    for (size_t i = 0; i < N; ++i)
+      __buffers[i] = malloc(8*1024);
+  }
----------------
Let's do `new char[8 * 1024]` instead (some platforms don't expose `std::malloc`).


================
Comment at: libcxx/test/libcxx/containers/sequences/deque/asan_turning_off.pass.cpp:32
+    for (size_t i = 0; i < N; ++i)
+      free(__buffers[i]);
+  }
----------------
And `delete[]` here.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D146815



More information about the libcxx-commits mailing list