Revert "VVP: initialize thread flags/words and codespace chunks"

This reverts commit 621f589e02.
This commit is contained in:
mjoekhan 2026-07-21 20:38:18 +05:00
parent 621f589e02
commit d2d16717d3
2 changed files with 3 additions and 10 deletions

View File

@ -46,8 +46,7 @@ static unsigned current_within_chunk = 0;
void codespace_init(void)
{
assert(current_chunk == 0);
/* Value-initialize so unused slots are not random (opcode NULL). */
first_chunk = new struct vvp_code_s [code_chunk_size]();
first_chunk = new struct vvp_code_s [code_chunk_size];
current_chunk = first_chunk;
current_chunk[0].opcode = &of_ZOMBIE;
@ -65,7 +64,7 @@ vvp_code_t codespace_next(void)
{
if (current_within_chunk == (code_chunk_size-1)) {
current_chunk[code_chunk_size-1].cptr
= new struct vvp_code_s [code_chunk_size]();
= new struct vvp_code_s [code_chunk_size];
current_chunk = current_chunk[code_chunk_size-1].cptr;
/* Put a link opcode on the end of the chunk. */

View File

@ -770,15 +770,9 @@ vthread_t vthread_new(vvp_code_t pc, __vpiScope*scope)
thr->flags[1] = BIT4_1;
thr->flags[2] = BIT4_X;
thr->flags[3] = BIT4_Z;
/* Initialize the remaining flags. Older code only cleared 4..7; the
codegen freely uses higher flag indices, so leave nothing
uninitialized for tools like valgrind. */
for (int idx = 4 ; idx < vthread_s::FLAGS_COUNT ; idx += 1)
for (int idx = 4 ; idx < 8 ; idx += 1)
thr->flags[idx] = BIT4_X;
for (int idx = 0 ; idx < vthread_s::WORDS_COUNT ; idx += 1)
thr->words[idx].w_uint = 0;
scope->threads .insert(thr);
return thr;
}