[libc-commits] [PATCH] D141091: [libc] add scanf float converter

Siva Chandra via Phabricator via libc-commits libc-commits at lists.llvm.org
Fri Jan 6 01:16:23 PST 2023


sivachandra added inline comments.


================
Comment at: libc/src/stdio/scanf_core/float_converter.cpp:25
+
+class VectorString {
+  static constexpr size_t INIT_BUFF_SIZE = 64;
----------------
Isn't this an equivalent of `std::string`? If yes, may be you should move it to CPP and name it `cpp::string`.


================
Comment at: libc/src/stdio/scanf_core/float_converter.cpp:36
+    if (str != local_buffer)
+      delete str;
+  }
----------------
This should be `delete [] str`?

But, I also think this is a case where `realloc` is the right allocator function to use instead of `new`/`delete`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141091



More information about the libc-commits mailing list