-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Remove SizeAndAlignment class in TZone code. #57649
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove SizeAndAlignment class in TZone code. #57649
Conversation
|
EWS run on current version of this PR (hash 4dd3d22) Details |
| struct TZoneSpecification { | ||
| HeapRef* addressOfHeapRef; | ||
| unsigned size; | ||
| uint16_t alignment; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not increase the size of TZoneSpecification. There's an unused padding bytes here that I'm fitting this alignment field into. Having the alignment here makes it easier to get this value later rather than always having to decode it from the descriptor.
kmiller68
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me with minor nit.
| #define BUSE_TZONE_SPEC_NAME_ARG 0 | ||
| #if BUSE_TZONE_SPEC_NAME_ARG | ||
| #define TZONE_SPEC_NAME_ARG(x) , x | ||
| #define TZONE_SPEC_NAME_ARG(x) x, __FILE__, __LINE__, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: We should probably use std::source_location for new code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll make this change in a follow up later. Gonna land this PR as is for now.
https://bugs.webkit.org/show_bug.cgi?id=306717 rdar://169370644 Reviewed by Keith Miller. The SizeAndAlignment logic belongs in TZoneSpecification which defines a TZone type's sorting algorithm / criteria. This refactoring paves the way to add alternate TZone categories that use different sorting algorithms for heap selection. Also added some debugging info (file and line number) to TZoneSpecification because classname alone is insufficient as there can be many classes with the same name. Also enhanced TZoneHeapManager::dumpRegisteredTypes(0 to also print the pid to distinguish between processes. No new tests because this is a refactoring patch. There is no behavior change.. * Source/bmalloc/bmalloc/TZoneHeap.h: (bmalloc::api::TZoneDescriptorHashTrait::hash): (bmalloc::api::TZoneSpecification::sizeClass const): (bmalloc::api::TZoneSpecification::encodeSize): (bmalloc::api::TZoneSpecification::encodeAlignment): (bmalloc::api::TZoneSpecification::encodeDescriptor): (bmalloc::api::SizeAndAlignment::encode): Deleted. (bmalloc::api::SizeAndAlignment::decodeSize): Deleted. (bmalloc::api::SizeAndAlignment::decodeAlignment): Deleted. * Source/bmalloc/bmalloc/TZoneHeapInlines.h: * Source/bmalloc/bmalloc/TZoneHeapManager.cpp: (bmalloc::api::TZoneDescriptorDecoder::TZoneDescriptorDecoder): (bmalloc::api::TZoneDescriptorDecoder::value const): (bmalloc::api::TZoneDescriptorDecoder::sizeClass const): (bmalloc::api::TZoneDescriptorDecoder::alignment const): (bmalloc::api::TZoneHeapManager::dumpRegisteredTypes): (bmalloc::api::TZoneHeapManager::bucketCountForSizeClass): (bmalloc::api::TZoneHeapManager::bucketForKey): (bmalloc::api::TZoneHeapManager::populateGroupBuckets): (bmalloc::api::TZoneHeapManager::heapRefForTZoneType): (bmalloc::api::TZoneHeapManager::TZoneHeapManager::heapRefForTZoneTypeDifferentSize): * Source/bmalloc/bmalloc/TZoneHeapManager.h: Canonical link: https://commits.webkit.org/306630@main
4dd3d22 to
24c117b
Compare
|
Committed 306630@main (24c117b): https://commits.webkit.org/306630@main Reviewed commits have been landed. Closing PR #57649 and removing active labels. |
24c117b
4dd3d22