Skip to content
Myr

exec_stack.h was not using jv_mem_realloc()

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Nicolas Williams · committed by Nicolas Williams · parent b963eba · Browse files · 1 file+2 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−1 removed

  • other:+2 added−1 removed

1 file+2 added−1 removed

modified:exec_stack.h+2 added-1 removed
2 unmodified lines
3#include <stddef.h>4#include <stdint.h>5#include <stdlib.h>6#include <string.h>7#include "jv_alloc.h"89struct determine_alignment {10 char x;11 union { int i; double d; uint64_t u64; size_t sz; void* ptr; } u;
41 unmodified lines
53 int old_mem_length = -(s->bound) + ALIGNMENT;54 char* old_mem_start = s->mem_end - old_mem_length;55 56 int new_mem_length = align_round_up((old_mem_length + sz + 256) * 2);56 char* new_mem_start = realloc(old_mem_start, new_mem_length);57 char* new_mem_start = jv_mem_realloc(old_mem_start, new_mem_length);58 memmove(new_mem_start + (new_mem_length - old_mem_length),59 new_mem_start, old_mem_length);60 s->mem_end = new_mem_start + new_mem_length;61 s->bound = -(new_mem_length - ALIGNMENT);
22 unmodified lines