diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2022-07-30 14:18:53 +0200 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2022-07-30 14:18:53 +0200 |
| commit | 8bc9baefd688945327e2b01d257f656d622f33f1 (patch) | |
| tree | 4db1db5ca66c4b1a44f18d3e0770fe5d032b7382 /src/box64context.c | |
| parent | 0fe835e0871b42104218c9440f599d7a9e2b1f2f (diff) | |
| download | box64-8bc9baefd688945327e2b01d257f656d622f33f1.tar.gz box64-8bc9baefd688945327e2b01d257f656d622f33f1.zip | |
Added BOX64_ROLLING_LOG=1 for a 'Just in Time LOG=2' on signal
Diffstat (limited to 'src/box64context.c')
| -rwxr-xr-x | src/box64context.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/box64context.c b/src/box64context.c index ef5b6c54..1d940b39 100755 --- a/src/box64context.c +++ b/src/box64context.c @@ -154,6 +154,12 @@ box64context_t *NewBox64Context(int argc) // init and put default values box64context_t *context = my_context = (box64context_t*)calloc(1, sizeof(box64context_t)); + if(cycle_log) + for(int i=0; i<CYCLE_LOG; ++i) { + context->log_call[i] = (char*)calloc(256, 1); + context->log_ret[i] = (char*)calloc(128, 1); + } + context->deferedInit = 1; context->sel_serial = 1; @@ -293,6 +299,12 @@ void FreeBox64Context(box64context_t** context) pthread_mutex_destroy(&ctx->mutex_thread); pthread_mutex_destroy(&ctx->mutex_bridge); + if(cycle_log) + for(int i=0; i<CYCLE_LOG; ++i) { + free(ctx->log_call[i]); + free(ctx->log_ret[i]); + } + free(ctx); } |