RETURN_ERROR_IF(objectEnd > ws->workspaceEnd, memory_allocation,
"table phase - alignment initial allocation failed!");
ws->objectEnd = objectEnd;
- ws->tableEnd = objectEnd;
- if (ws->tableEnd > ws->tableValidEnd) ws->tableValidEnd = objectEnd;
- }
- }
+ ws->tableEnd = objectEnd; /* table area starts being empty */
+ if (ws->tableValidEnd < ws->tableEnd) {
+ ws->tableValidEnd = ws->tableEnd;
+ } } }
ws->phase = phase;
ZSTD_cwksp_assert_internal_consistency(ws);
}