-
Notifications
You must be signed in to change notification settings - Fork 132
Open
Description
- In class SizeOf, I found the size of OptoinalXxx.emty() is zero. In my opinion, the size of empty instance should be OPTIONAL_INSTANCE_SIZE or OPTIONAL_INT_INSTANCE_SIZE.
- Because it's an instance and will use basic memory for class layout
public static <T> long sizeOf(Optional<T> optional, ToLongFunction<T> valueSize) { return optional != null && optional.isPresent() ? OPTIONAL_INSTANCE_SIZE + valueSize.applyAsLong(optional.get()) : 0; } public static long sizeOf(OptionalInt optional) { return optional != null && optional.isPresent() ? OPTIONAL_INT_INSTANCE_SIZE : 0; }
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels