This PR contains multiple things (let me know if you want to split them)
Add get_age in segments, then add a new field age in Item so that we can return age to caller.
Add RichItem to return item_info and item_info_ptr, these two are used to support opportunistic concurrency control. Not sure adding a new struct is better than adding the fields to Item, but given there might be fields (like these) that we often do not need, creating a new struct might be better.
add a call to expire before we evict, this avoids the problem that users may forget to call expire.
This PR contains multiple things (let me know if you want to split them)
get_age
in segments, then add a new fieldage
inItem
so that we can return age to caller.RichItem
to returnitem_info
anditem_info_ptr
, these two are used to support opportunistic concurrency control. Not sure adding a new struct is better than adding the fields toItem
, but given there might be fields (like these) that we often do not need, creating a new struct might be better.expire
.