Refactor Freeing CCtxes / CDicts Inside Workspaces

This commit is contained in:
W. Felix Handte
2019-10-10 13:40:16 -04:00
parent 143b296cf6
commit ef0b5707c5
2 changed files with 16 additions and 11 deletions
+7
View File
@@ -217,6 +217,13 @@ MEM_STATIC void ZSTD_cwksp_internal_advance_phase(
}
}
/**
* Returns whether this object/buffer/etc was allocated in this workspace.
*/
MEM_STATIC int ZSTD_cwksp_owns_buffer(const ZSTD_cwksp* ws, const void* ptr) {
return (ptr != NULL) && (ws->workspace <= ptr) && (ptr <= ws->workspaceEnd);
}
/**
* Internal function. Do not use directly.
*/