Skip to content

Commit

Permalink
Fix implicit cast from INSTANCE_SIZE_PADDED
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Wiseguy committed Oct 17, 2024
1 parent c6c2473 commit 8abca70
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion o1heap/o1heap.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ struct O1HeapInstance

/// The amount of space allocated for the heap instance.
/// Its size is padded up to O1HEAP_ALIGNMENT to ensure correct alignment of the allocation arena that follows.
#define INSTANCE_SIZE_PADDED (((uint32_t)sizeof(O1HeapInstance) + O1HEAP_ALIGNMENT - 1U) & ~(O1HEAP_ALIGNMENT - 1U))
#define INSTANCE_SIZE_PADDED ((uint32_t)((sizeof(O1HeapInstance) + O1HEAP_ALIGNMENT - 1U) & ~(O1HEAP_ALIGNMENT - 1U)))

static_assert(INSTANCE_SIZE_PADDED >= sizeof(O1HeapInstance), "Invalid instance footprint computation");
static_assert((INSTANCE_SIZE_PADDED % O1HEAP_ALIGNMENT) == 0U, "Invalid instance footprint computation");
Expand Down

0 comments on commit 8abca70

Please sign in to comment.