diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2022-10-26 14:20:39 +0200 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2022-10-26 14:20:39 +0200 |
| commit | 612e94be9d1511c8b56155918b2c462588b8ee54 (patch) | |
| tree | 432927f5afa74251e610f29544e0c7f1c9327ce2 /src/box64context.c | |
| parent | 7a95c78ba014bcf9c65bac82828f1035142affdd (diff) | |
| download | box64-612e94be9d1511c8b56155918b2c462588b8ee54.tar.gz box64-612e94be9d1511c8b56155918b2c462588b8ee54.zip | |
More flexibility for BOX64_ROLLING_LOG
Diffstat (limited to 'src/box64context.c')
| -rwxr-xr-x | src/box64context.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/box64context.c b/src/box64context.c index 46860a08..d5e1700f 100755 --- a/src/box64context.c +++ b/src/box64context.c @@ -148,11 +148,14 @@ box64context_t *NewBox64Context(int argc) // init and put default values box64context_t *context = my_context = (box64context_t*)box_calloc(1, sizeof(box64context_t)); - if(cycle_log) - for(int i=0; i<CYCLE_LOG; ++i) { + if(cycle_log) { + context->log_call = (char**)box_calloc(cycle_log, sizeof(char*)); + context->log_ret = (char**)box_calloc(cycle_log, sizeof(char*)); + for(int i=0; i<cycle_log; ++i) { context->log_call[i] = (char*)box_calloc(256, 1); context->log_ret[i] = (char*)box_calloc(128, 1); } + } context->deferedInit = 1; context->sel_serial = 1; @@ -296,11 +299,14 @@ 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) { + if(cycle_log) { + for(int i=0; i<cycle_log; ++i) { box_free(ctx->log_call[i]); box_free(ctx->log_ret[i]); } + box_free(ctx->log_call); + box_free(ctx->log_ret); + } box_free(ctx); } |