[libc-commits] [libc] 39cf880 - [libc][stdlib] Change old unsigned short variables to size_t (#95065)
via libc-commits
libc-commits at lists.llvm.org
Mon Jun 10 20:19:28 PDT 2024
Author: PiJoules
Date: 2024-06-10T20:19:24-07:00
New Revision: 39cf8803391e695c7ec3a85fc1b2c4622f52b481
URL: https://github.com/llvm/llvm-project/commit/39cf8803391e695c7ec3a85fc1b2c4622f52b481
DIFF: https://github.com/llvm/llvm-project/commit/39cf8803391e695c7ec3a85fc1b2c4622f52b481.diff
LOG: [libc][stdlib] Change old unsigned short variables to size_t (#95065)
They were assigned from calls to find_chunk_ptr_for_size which return
size_t now.
Added:
Modified:
libc/src/stdlib/freelist.h
Removed:
################################################################################
diff --git a/libc/src/stdlib/freelist.h b/libc/src/stdlib/freelist.h
index 20b4977835bef..c01ed6eddb7d4 100644
--- a/libc/src/stdlib/freelist.h
+++ b/libc/src/stdlib/freelist.h
@@ -99,7 +99,7 @@ bool FreeList<NUM_BUCKETS>::add_chunk(span<cpp::byte> chunk) {
aliased.bytes = chunk.data();
- unsigned short chunk_ptr = find_chunk_ptr_for_size(chunk.size(), false);
+ size_t chunk_ptr = find_chunk_ptr_for_size(chunk.size(), false);
// Add it to the correct list.
aliased.node->size = chunk.size();
@@ -114,7 +114,7 @@ span<cpp::byte> FreeList<NUM_BUCKETS>::find_chunk(size_t size) const {
if (size == 0)
return span<cpp::byte>();
- unsigned short chunk_ptr = find_chunk_ptr_for_size(size, true);
+ size_t chunk_ptr = find_chunk_ptr_for_size(size, true);
// Check that there's data. This catches the case where we run off the
// end of the array
@@ -144,7 +144,7 @@ span<cpp::byte> FreeList<NUM_BUCKETS>::find_chunk(size_t size) const {
template <size_t NUM_BUCKETS>
bool FreeList<NUM_BUCKETS>::remove_chunk(span<cpp::byte> chunk) {
- unsigned short chunk_ptr = find_chunk_ptr_for_size(chunk.size(), true);
+ size_t chunk_ptr = find_chunk_ptr_for_size(chunk.size(), true);
// Walk that list, finding the chunk.
union {
More information about the libc-commits
mailing list