You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
help?> Base.summarysize
Base.summarysize(obj; exclude=Union{...}, chargeall=Union{...}) -> Int
Compute the amount of memory, in bytes, used by all unique objects reachable from
the argument.
Symbols are interned strings with a hash, and all subsequent references are a pointer to the interned value
So why would we have summarysize report 0? Shouldn't summarysize(x) == sizeof(x) for x::Symbol?
That method instance was originally added in 8322d79, with a comment reading # these three cases override the exception that would be thrown by Core.sizeof. Looking at the current source code for summarysize, I can't find any sizeof calls that would throw if that definition wasn't there. Is this a historical artifact? I've tried to find the commit where the comment was removed (e.g., it's still there in 34236e7) but git log -c -S and co. failed me.
Removing the mi doesn't seem to break anything, and we get
From a conversation at Slack w/ @tecosaur:
summarysize
is explicitly coded to return0
forSymbol
s.The docstring reads:
help?> Base.summarysize Base.summarysize(obj; exclude=Union{...}, chargeall=Union{...}) -> Int Compute the amount of memory, in bytes, used by all unique objects reachable from the argument.
Symbols are interned strings with a hash, and all subsequent references are a pointer to the interned value
julia/src/julia.h
Lines 140 to 148 in 86cba99
julia/src/symbol.c
Lines 35 to 49 in 86cba99
So why would we have
summarysize
report0
? Shouldn'tsummarysize(x) == sizeof(x)
forx::Symbol
?That method instance was originally added in 8322d79, with a comment reading
# these three cases override the exception that would be thrown by Core.sizeof
. Looking at the current source code forsummarysize
, I can't find anysizeof
calls that would throw if that definition wasn't there. Is this a historical artifact? I've tried to find the commit where the comment was removed (e.g., it's still there in 34236e7) butgit log -c -S
and co. failed me.Removing the mi doesn't seem to break anything, and we get
instead, which to me feels more close to what's actually going on behind the hood.
The text was updated successfully, but these errors were encountered: