(WTF::IntegralMarkableTraits::isEmptyValue): We can specify a constant value as an empty value. (WTF::std::underlying_type::type>::max): EnumMarkableTraits can be used as an MarkableTraits for enum Here instead of importing it since we would like to have (1) integrated interfaces with std::optional and (2)Īligned function names to HashTraits' `isEmptyValue` and `emptyValue`. This way, we can make `sizeof(WTF::Markable) = sizeof(T)`. Then, we use this empty value instead of having boolįlag. `Traits::isEmptyValue(value)` and `Traits::emptyValue()`. ![]() In our HashTable implementation, we need DeletedĪnd Empty value, which can represent Deleted and Empty values without sacrificing storage efficiency. This is very similar problem to our HashTable implementation. If we know that WallTime has a value that represents invalid, we can use it instead and save the storage. This class has significant amount of padding between m_timeA / m_timeB, m_timeB / m_timeC due to the above bool. ![]() It always has a bool indicating that the value is nullopt or not. However, std::optional has storage efficiency ![]() We can represent a value with nullopt by using std::optional.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |