From 58b9e2cb60b4abbee41e65e024e70dee457390ca Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Thu, 21 Nov 2013 06:28:06 -0800 Subject: [PATCH] debug prints when a global stack is realloc'ed --- src/error.c | 5 +++++ src/symbol.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/error.c b/src/error.c index 224d9cd8..c75b9e9c 100644 --- a/src/error.c +++ b/src/error.c @@ -75,6 +75,11 @@ pic_error_with_exception_handler(pic_state *pic) thunk = pic_proc_ptr(w); if (pic->ridx >= pic->rlen) { + +#if DEBUG + puts("rescue realloced"); +#endif + pic->rescue = (struct pic_proc **)pic_realloc(pic, pic->rescue, pic->rlen * 2); pic->rlen *= 2; } diff --git a/src/symbol.c b/src/symbol.c index 74b6fcb8..6c0fd239 100644 --- a/src/symbol.c +++ b/src/symbol.c @@ -16,6 +16,11 @@ pic_intern_cstr(pic_state *pic, const char *str) } if (pic->slen >= pic->scapa) { + +#if DEBUG + puts("sym_pool realloced"); +#endif + pic->scapa *= 2; pic->sym_pool = pic_realloc(pic, pic->sym_pool, sizeof(const char *) * pic->scapa); }