mirror of
https://github.com/hkalexling/Mango.git
synced 2025-08-02 10:55:30 -04:00
Use bytesize and add comments
This commit is contained in:
parent
365f71cd1d
commit
0a8fd993e5
@ -171,8 +171,10 @@ private class SortedEntriesCacheEntry
|
||||
end
|
||||
|
||||
def instance_size
|
||||
@value.size * (instance_sizeof(String) + sizeof(String)) +
|
||||
@value.sum(&.size) + instance_sizeof(SortedEntriesCacheEntry)
|
||||
instance_sizeof(SortedEntriesCacheEntry) + # sizeof itself
|
||||
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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user