Lines Matching defs:workspace

24 /* Since the workspace is effectively its own little malloc implementation /
26 * each internal element of the workspace, so ASAN will catch overruns that
27 * reach outside an object but that stay inside the workspace.
49 * Used to describe whether the workspace is statically allocated (and will not
62 * is called the workspace.
65 * from this workspace for each internal datastructure:
85 * - We would like to reuse the objects in the workspace for multiple
89 * - We would like to be able to efficiently reuse the workspace across
98 * [ ... workspace ... ]
101 * The various objects that live in the workspace are divided into the
106 * this must be the first object in the workspace, since ZSTD_customFree{CCtx,
111 * nonetheless "dynamically" allocated in the workspace so that we can
134 * correctly packed into the workspace buffer. That order is:
143 void* workspace;
165 assert(ws->workspace <= ws->objectEnd);
183 * Use this to determine how much space in the workspace we will consume to
313 * Returns whether this object/buffer/etc was allocated in this workspace.
317 return (ptr != NULL) && (ws->workspace <= ptr) && (ptr <= ws->workspaceEnd);
396 * Note : should happen only once, at workspace first initialization
490 * The provided workspace takes ownership of the buffer [start, start+size).
491 * Any existing values in the workspace are ignored (the previously managed
495 DEBUGLOG(4, "cwksp: init'ing workspace with %zd bytes", size);
497 ws->workspace = start;
499 ws->objectEnd = ws->workspace;
509 void* workspace = ZSTD_customMalloc(size, customMem);
510 DEBUGLOG(4, "cwksp: creating new workspace with %zd bytes", size);
511 RETURN_ERROR_IF(workspace == NULL, memory_allocation, "NULL pointer!");
512 ZSTD_cwksp_init(ws, workspace, size, ZSTD_cwksp_dynamic_alloc);
517 void *ptr = ws->workspace;
518 DEBUGLOG(4, "cwksp: freeing workspace");
524 * Moves the management of a workspace from one cwksp to another. The src cwksp
533 return (size_t)((BYTE*)ws->workspaceEnd - (BYTE*)ws->workspace);
537 return (size_t)((BYTE*)ws->tableEnd - (BYTE*)ws->workspace)
559 /* Due to alignment, when reusing a workspace, we can actually consume 63 fewer or more bytes