Skip to content

Commit

Permalink
exec_stack.h was not using jv_mem_realloc()
Browse files Browse the repository at this point in the history
  • Loading branch information
nicowilliams committed Jul 8, 2014
1 parent b963eba commit 80a9937
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion exec_stack.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include "jv_alloc.h"

struct determine_alignment {
char x;
Expand Down Expand Up @@ -53,7 +54,7 @@ static void stack_reallocate(struct stack* s, size_t sz) {
char* old_mem_start = s->mem_end - old_mem_length;

int new_mem_length = align_round_up((old_mem_length + sz + 256) * 2);
char* new_mem_start = realloc(old_mem_start, new_mem_length);
char* new_mem_start = jv_mem_realloc(old_mem_start, new_mem_length);
memmove(new_mem_start + (new_mem_length - old_mem_length),
new_mem_start, old_mem_length);
s->mem_end = new_mem_start + new_mem_length;
Expand Down

0 comments on commit 80a9937

Please sign in to comment.