parent
1c8e191918
commit
c88caa764d
14
vpi/fstapi.c
14
vpi/fstapi.c
|
|
@ -704,13 +704,14 @@ if(xc && !xc->already_in_close && !xc->already_in_flush)
|
||||||
|
|
||||||
xc->already_in_close = 1; /* never need to zero this out as it is freed at bottom */
|
xc->already_in_close = 1; /* never need to zero this out as it is freed at bottom */
|
||||||
|
|
||||||
if(xc->section_header_only && xc->section_header_truncpos)
|
if(xc->section_header_only && xc->section_header_truncpos && (xc->vchn_siz <= 1) && (!xc->is_initial_time))
|
||||||
{
|
{
|
||||||
fstFtruncate(fileno(xc->handle), xc->section_header_truncpos);
|
fstFtruncate(fileno(xc->handle), xc->section_header_truncpos);
|
||||||
fseeko(xc->handle, xc->section_header_truncpos, SEEK_SET);
|
fseeko(xc->handle, xc->section_header_truncpos, SEEK_SET);
|
||||||
xc->section_header_only = 0;
|
xc->section_header_only = 0;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
xc->skip_writing_section_hdr = 1;
|
xc->skip_writing_section_hdr = 1;
|
||||||
if(!xc->size_limit_locked)
|
if(!xc->size_limit_locked)
|
||||||
{
|
{
|
||||||
|
|
@ -726,6 +727,7 @@ if(xc && !xc->already_in_close && !xc->already_in_flush)
|
||||||
}
|
}
|
||||||
fstWriterFlushContext(xc);
|
fstWriterFlushContext(xc);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
fstDestroyMmaps(xc, 1);
|
fstDestroyMmaps(xc, 1);
|
||||||
|
|
||||||
/* write out geom section */
|
/* write out geom section */
|
||||||
|
|
@ -1603,10 +1605,10 @@ if(xc)
|
||||||
/*
|
/*
|
||||||
* value and time change emission
|
* value and time change emission
|
||||||
*/
|
*/
|
||||||
void fstWriterEmitValueChange(void *ctx, fstHandle handle, void *val)
|
void fstWriterEmitValueChange(void *ctx, fstHandle handle, const void *val)
|
||||||
{
|
{
|
||||||
struct fstWriterContext *xc = (struct fstWriterContext *)ctx;
|
struct fstWriterContext *xc = (struct fstWriterContext *)ctx;
|
||||||
unsigned char *buf = (unsigned char *)val;
|
const unsigned char *buf = (const unsigned char *)val;
|
||||||
uint32_t offs;
|
uint32_t offs;
|
||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
|
|
@ -3412,6 +3414,7 @@ for(;;)
|
||||||
printf("\tindx_pos: %d (%d bytes)\n", (int)indx_pos, (int)chain_clen);
|
printf("\tindx_pos: %d (%d bytes)\n", (int)indx_pos, (int)chain_clen);
|
||||||
#endif
|
#endif
|
||||||
chain_cmem = malloc(chain_clen);
|
chain_cmem = malloc(chain_clen);
|
||||||
|
if(!chain_cmem) goto block_err;
|
||||||
fseeko(xc->f, indx_pos, SEEK_SET);
|
fseeko(xc->f, indx_pos, SEEK_SET);
|
||||||
fstFread(chain_cmem, chain_clen, 1, xc->f);
|
fstFread(chain_cmem, chain_clen, 1, xc->f);
|
||||||
|
|
||||||
|
|
@ -3425,6 +3428,8 @@ for(;;)
|
||||||
chain_table_lengths = malloc((vc_maxhandle+1) * sizeof(uint32_t));
|
chain_table_lengths = malloc((vc_maxhandle+1) * sizeof(uint32_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!chain_table || !chain_table_lengths) goto block_err;
|
||||||
|
|
||||||
pnt = chain_cmem;
|
pnt = chain_cmem;
|
||||||
idx = 0;
|
idx = 0;
|
||||||
pval = 0;
|
pval = 0;
|
||||||
|
|
@ -3792,6 +3797,7 @@ for(;;)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
block_err:
|
||||||
free(tc_head);
|
free(tc_head);
|
||||||
free(chain_cmem);
|
free(chain_cmem);
|
||||||
free(mem_for_traversal);
|
free(mem_for_traversal);
|
||||||
|
|
|
||||||
|
|
@ -157,7 +157,7 @@ void fstWriterSetTimescaleFromString(void *ctx, const char *s);
|
||||||
void fstWriterSetScope(void *ctx, enum fstScopeType scopetype,
|
void fstWriterSetScope(void *ctx, enum fstScopeType scopetype,
|
||||||
const char *scopename, const char *scopecomp);
|
const char *scopename, const char *scopecomp);
|
||||||
void fstWriterSetUpscope(void *ctx);
|
void fstWriterSetUpscope(void *ctx);
|
||||||
void fstWriterEmitValueChange(void *ctx, fstHandle handle, void *val);
|
void fstWriterEmitValueChange(void *ctx, fstHandle handle, const void *val);
|
||||||
void fstWriterEmitDumpActive(void *ctx, int enable);
|
void fstWriterEmitDumpActive(void *ctx, int enable);
|
||||||
void fstWriterEmitTimeChange(void *ctx, uint64_t tim);
|
void fstWriterEmitTimeChange(void *ctx, uint64_t tim);
|
||||||
void fstWriterFlushContext(void *ctx);
|
void fstWriterFlushContext(void *ctx);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue