(minor TODO fix)

partial-rewrite
Ben Blazak 2013-04-09 13:22:01 -07:00
parent e8bec2c0a2
commit 9ac5701e7e
1 changed files with 2 additions and 2 deletions

View File

@ -44,10 +44,10 @@ stack_t _stack = {
.data = (element_t *) malloc( TYPE_SIZE * BLOCK_SIZE ),
};
// todo: this should not be the final function
// TODO: this should not be the final function
static uint8_t _resize_stack(stack_t stack) {
uint8_t margin = stack.allocated - stack.filled;
if (margin == 0 || margin > MARGIN) {
if (margin == 0 || margin > MARGIN + BLOCK_SIZE) {
uint8_t new_size = stack.allocated + TYPE_SIZE * (margin == 0)
? BLOCK_SIZE
: -BLOCK_SIZE;