summaryrefslogtreecommitdiffstats
path: root/library/cpp/yt/string
diff options
context:
space:
mode:
authorvasko <[email protected]>2026-03-06 10:18:45 +0300
committervasko <[email protected]>2026-03-06 10:40:38 +0300
commit39ae7ca20aaff68379747bae5db37b9d446cf9ee (patch)
tree34701cd9dbe0941121476cb4e9207e024ba97d60 /library/cpp/yt/string
parenta644429ec6f63e0cb3f6f5920073bc203e3d8c73 (diff)
[yt/string] bit-independent version of FormatPointerValue
commit_hash:77b05e63c7d030fccb8d13d83f5e9dc4f660e19d
Diffstat (limited to 'library/cpp/yt/string')
-rw-r--r--library/cpp/yt/string/format.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/library/cpp/yt/string/format.cpp b/library/cpp/yt/string/format.cpp
index 47b0c1d712d..07120aae612 100644
--- a/library/cpp/yt/string/format.cpp
+++ b/library/cpp/yt/string/format.cpp
@@ -111,12 +111,13 @@ void FormatPointerValue(
const void* value,
TStringBuf format)
{
- static_assert(sizeof(value) == sizeof(ui64));
+ static_assert(sizeof(value) == sizeof(uintptr_t));
+
if (format == TStringBuf("p") || format == TStringBuf("v")) {
builder->AppendString(TStringBuf("0x"));
- FormatValue(builder, reinterpret_cast<ui64>(value), TStringBuf("x"));
+ FormatValue(builder, reinterpret_cast<uintptr_t>(value), TStringBuf("x"));
} else if (format == TStringBuf("x") || format == TStringBuf("X")) {
- FormatValue(builder, reinterpret_cast<ui64>(value), format);
+ FormatValue(builder, reinterpret_cast<uintptr_t>(value), format);
} else {
builder->AppendString("<invalid pointer format>");
}