[libcxx-commits] [PATCH] D153037: [libcxx] Migrate posix_compat.h layer to not use CRT filesystem functions.

James Y Knight via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jun 15 12:34:33 PDT 2023


jyknight added inline comments.


================
Comment at: libcxx/src/filesystem/posix_compat.h:353
+
+  size_t buff_size = MAX_PATH + 10;
+  std::unique_ptr<wchar_t, decltype(&::free)> buff(static_cast<wchar_t*>(malloc(buff_size * sizeof(wchar_t))), &::free);
----------------
Mordante wrote:
> Please add comment why this magic value (10) is used. 
I'm not sure why it was chosen...I copied that from realpath, below. It doesn't make a difference functionally, since if we go over, we simply reallocate.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D153037



More information about the libcxx-commits mailing list