-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Open
Labels
observabilitymetrics, timing, understandability, reflection, logging, ...metrics, timing, understandability, reflection, logging, ...
Description
I've recently been working on my About.jl package, for showing more information about the internals/memory representation of Julia values. When looking into strings a bit more, I came across this bit of jl_alloc_string
:
Line 301 in e9a24d4
size_t sz = sizeof(size_t) + len + 1; // add space for trailing \nul protector and size |
In the REPL, with the 3-codunit string hey
, I see this:
julia> ncodeunits("hey")
3
julia> Base.summarysize("hey")
11
Since I'm on a 64-byte system, sizeof(size_t)
should be 64-bits/8-bytes, and so 8 + 3 + 1 gives us ... 12, not 11.
It seems like Base.summarysize
might be missing the trailing null byte?
Metadata
Metadata
Assignees
Labels
observabilitymetrics, timing, understandability, reflection, logging, ...metrics, timing, understandability, reflection, logging, ...