[compiler-rt] [scudo] Add `__scudo_get_info` symbol to export stats to a buffer. (PR #130273)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 4 10:36:45 PDT 2025
================
@@ -229,6 +229,15 @@ void ScopedString::append(const char *Format, ...) {
va_end(Args);
}
+size_t ScopedString::copyToBuffer(char *OutputBase, size_t OutputLength) {
+ if (OutputBase && OutputLength) {
+ const size_t Written = Min(length(), OutputLength - 1);
+ memcpy(OutputBase, data(), Written);
+ OutputBase[Written] = '\0';
+ }
+ return length() + 1;
----------------
ChiaHungDuan wrote:
I think this should return the length of data copied?
https://github.com/llvm/llvm-project/pull/130273
More information about the llvm-commits
mailing list