summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2023-02-07 19:31:57 -0400
committermrb0nk500 <b0nk@b0nk.xyz>2023-02-07 19:31:57 -0400
commit25b289d12642ed5334d1c25beec9043fb5d03ee1 (patch)
tree21c8abcf3e8225e2ed2292d8b9367a0dc948a40a
parenta1340d27fd35d3c863ec5fc807fd9179767559d2 (diff)
THeap: Rename `aligned_size` -> `node_size`
-rw-r--r--src/pso/THeap.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/pso/THeap.cpp b/src/pso/THeap.cpp
index e7ebdfa..5af77d1 100644
--- a/src/pso/THeap.cpp
+++ b/src/pso/THeap.cpp
@@ -65,21 +65,21 @@ void *THeap::heap_alloc(size_t size) {
heap_node *node;
heap_node *tmp;
- u32 aligned_size = (sizeof(heap_node) - 1) + align + size;
- aligned_size &= -align;
+ u32 node_size = (sizeof(heap_node) - 1) + align + size;
+ node_size &= -align;
for (; node = prev_node->next, node != NULL; prev_node = node) {
- if (node->remaining_size >= aligned_size) {
- if (aligned_size == node->remaining_size) {
+ if (node->remaining_size >= node_size) {
+ if (node_size == node->remaining_size) {
prev_node->next = node->next;
} else {
const u8 *next_u8 = (u8 *)&node->next;
- tmp = (heap_node *)&next_u8[aligned_size];
+ tmp = (heap_node *)&next_u8[node_size];
tmp->next = node->next;
- tmp->remaining_size = node->remaining_size - aligned_size;
+ tmp->remaining_size = node->remaining_size - node_size;
- node->remaining_size = aligned_size;
+ node->remaining_size = node_size;
prev_node->next = tmp;
}
return node + 1;