Lines Matching defs:workspace
26 /* Since the workspace is effectively its own little malloc implementation /
28 * each internal element of the workspace, so ASAN will catch overruns that
29 * reach outside an object but that stay inside the workspace.
52 * Used to describe whether the workspace is statically allocated (and will not
65 * is called the workspace.
68 * from this workspace for each internal datastructure:
88 * - We would like to reuse the objects in the workspace for multiple
92 * - We would like to be able to efficiently reuse the workspace across
99 * Workspace Layout:
101 * [ ... workspace ... ]
104 * The various objects that live in the workspace are divided into the
109 * this must be the first object in the workspace, since ZSTD_customFree{CCtx,
114 * nonetheless "dynamically" allocated in the workspace so that we can
117 * - Entropy Workspace
146 * correctly packed into the workspace buffer. That order is:
156 void* workspace;
180 assert(ws->workspace <= ws->objectEnd);
187 assert(ws->workspace <= ws->initOnceStart);
213 * Use this to determine how much space in the workspace we will consume to
273 * which we can allocate from the end of the workspace.
350 * Returns whether this object/buffer/etc was allocated in this workspace.
354 return (ptr != NULL) && (ws->workspace <= ptr) && (ptr < ws->workspaceEnd);
415 * 1. Not usable as initOnce memory (end of workspace)
454 * start of the workspace */
489 * Note : should happen only once, at workspace first initialization
531 * Note : should happen only once, at workspace first initialization
605 /* We don't do this when the workspace is statically allocated, because
607 * workspace's lifecycle to unpoison the memory.
629 * the workspace except for the areas in which we expect memory reuse
641 /* We don't do this when the workspace is statically allocated, because
643 * workspace's lifecycle to unpoison the memory.
661 return (size_t)((BYTE*)ws->workspaceEnd - (BYTE*)ws->workspace);
665 return (size_t)((BYTE*)ws->tableEnd - (BYTE*)ws->workspace)
670 * The provided workspace takes ownership of the buffer [start, start+size).
671 * Any existing values in the workspace are ignored (the previously managed
675 DEBUGLOG(4, "cwksp: init'ing workspace with %zd bytes", size);
677 ws->workspace = start;
679 ws->objectEnd = ws->workspace;
690 void* workspace = ZSTD_customMalloc(size, customMem);
691 DEBUGLOG(4, "cwksp: creating new workspace with %zd bytes", size);
692 RETURN_ERROR_IF(workspace == NULL, memory_allocation, "NULL pointer!");
693 ZSTD_cwksp_init(ws, workspace, size, ZSTD_cwksp_dynamic_alloc);
698 void *ptr = ws->workspace;
699 DEBUGLOG(4, "cwksp: freeing workspace");
710 * Moves the management of a workspace from one cwksp to another. The src cwksp