mirror of
https://github.com/hkalexling/Mango.git
synced 2025-08-03 03:15:31 -04:00
Use bytesize and add comments
This commit is contained in:
parent
365f71cd1d
commit
0a8fd993e5
@ -171,8 +171,10 @@ private class SortedEntriesCacheEntry
|
|||||||
end
|
end
|
||||||
|
|
||||||
def instance_size
|
def instance_size
|
||||||
@value.size * (instance_sizeof(String) + sizeof(String)) +
|
instance_sizeof(SortedEntriesCacheEntry) + # sizeof itself
|
||||||
@value.sum(&.size) + instance_sizeof(SortedEntriesCacheEntry)
|
instance_sizeof(String) + @key.bytesize + # allocated memory for @key
|
||||||
|
@value.size * (instance_sizeof(String) + sizeof(String)) +
|
||||||
|
@value.sum(&.bytesize) # elements in Array(String)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user