EST_Chunk.cc (speech_tools-2.4-release) | : | EST_Chunk.cc (speech_tools-2.5.0-release) | ||
---|---|---|---|---|
skipping to change at line 290 | skipping to change at line 290 | |||
/* And one which ensures that a chunk is not shared. Do this before */ | /* And one which ensures that a chunk is not shared. Do this before */ | |||
/* writing to the memory. The first version is told how much of the */ | /* writing to the memory. The first version is told how much of the */ | |||
/* memory to copy, the second just copies it all. */ | /* memory to copy, the second just copies it all. */ | |||
/* */ | /* */ | |||
/************************************************************************/ | /************************************************************************/ | |||
void cp_make_updatable(EST_ChunkPtr &cp, EST_Chunk::EST_chunk_size inuse) | void cp_make_updatable(EST_ChunkPtr &cp, EST_Chunk::EST_chunk_size inuse) | |||
{ | { | |||
if (cp.ptr && cp.ptr->count > 1) | if (cp.ptr && cp.ptr->count > 1) | |||
{ | { | |||
EST_Chunk *newchunk = new(cp.ptr->size) EST_Chunk; | /* Changed 2017/02/17 as ptr-size is often zero (gcc6-O2) */ | |||
EST_Chunk *newchunk = new(inuse /* cp.ptr->size */) EST_Chunk; | ||||
memcpy(newchunk->memory, cp.ptr->memory, inuse); | memcpy(newchunk->memory, cp.ptr->memory, inuse); | |||
cp = newchunk; | cp = newchunk; | |||
} | } | |||
} | } | |||
void cp_make_updatable(EST_ChunkPtr &cp) | void cp_make_updatable(EST_ChunkPtr &cp) | |||
{ | { | |||
if (cp.ptr && cp.ptr->count > 1) | if (cp.ptr && cp.ptr->count > 1) | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 2 lines changed or added |