Skip to content

Conversation

@wangqin0
Copy link

Summary

  • Added size validation to SimpleAllocator constructor to ensure minimum allocation size of sizeof(void*)
  • Updated documentation in CacheLocality.h to clarify that allocations smaller than sizeof(void*) are rounded up
  • Added test case CoreAllocator.MinimumAllocationSize to verify correct behavior for small allocations

Test plan

  • Added new test CoreAllocator.MinimumAllocationSize that verifies 1-byte, 4-byte, and 8-byte allocations work correctly
  • Run existing CacheLocalityTest suite to ensure no regressions

Summary: Added a static assertion to ensure that the size passed to SimpleAllocator is at least the size of a pointer. If the size is smaller, an exception is thrown. Updated documentation to clarify that allocations smaller than sizeof(void*) are rounded up. Added a new test case to verify the behavior of coreMalloc for small allocations.
@meta-cla meta-cla bot added the CLA Signed label Jan 14, 2026
@wangqin0
Copy link
Author

closes #2538

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant