diff options
-rw-r--r-- | src/pso/THeap.cpp | 14 |
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; |