Lines Matching full:workspace

27 /* Since the workspace is effectively its own little malloc implementation /
29 * each internal element of the workspace, so ASAN will catch overruns that
30 * 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
137 * correctly packed into the workspace buffer. That order is:
146 void* workspace; member
168 assert(ws->workspace <= ws->objectEnd); in ZSTD_cwksp_assert_internal_consistency()
186 * Use this to determine how much space in the workspace we will consume to
320 * Returns whether this object/buffer/etc was allocated in this workspace.
324 return (ptr != NULL) && (ws->workspace <= ptr) && (ptr <= ws->workspaceEnd); in ZSTD_cwksp_owns_buffer()
422 * Note : should happen only once, at workspace first initialization
515 /* We don't do this when the workspace is statically allocated, because in ZSTD_cwksp_clear_tables()
517 * workspace's lifecycle to unpoison the memory. in ZSTD_cwksp_clear_tables()
539 * the workspace (or at least the non-static, non-table parts of it) in ZSTD_cwksp_clear()
548 /* We don't do this when the workspace is statically allocated, because in ZSTD_cwksp_clear()
550 * workspace's lifecycle to unpoison the memory. in ZSTD_cwksp_clear()
568 * The provided workspace takes ownership of the buffer [start, start+size).
569 * Any existing values in the workspace are ignored (the previously managed
573 DEBUGLOG(4, "cwksp: init'ing workspace with %zd bytes", size); in ZSTD_cwksp_init()
575 ws->workspace = start; in ZSTD_cwksp_init()
577 ws->objectEnd = ws->workspace; in ZSTD_cwksp_init()
587 void* workspace = ZSTD_customMalloc(size, customMem); in ZSTD_cwksp_create() local
588 DEBUGLOG(4, "cwksp: creating new workspace with %zd bytes", size); in ZSTD_cwksp_create()
589 RETURN_ERROR_IF(workspace == NULL, memory_allocation, "NULL pointer!"); in ZSTD_cwksp_create()
590 ZSTD_cwksp_init(ws, workspace, size, ZSTD_cwksp_dynamic_alloc); in ZSTD_cwksp_create()
595 void *ptr = ws->workspace; in ZSTD_cwksp_free()
596 DEBUGLOG(4, "cwksp: freeing workspace"); in ZSTD_cwksp_free()
602 * Moves the management of a workspace from one cwksp to another. The src cwksp
611 return (size_t)((BYTE*)ws->workspaceEnd - (BYTE*)ws->workspace); in ZSTD_cwksp_sizeof()
615 return (size_t)((BYTE*)ws->tableEnd - (BYTE*)ws->workspace) in ZSTD_cwksp_used()
637 … /* Due to alignment, when reusing a workspace, we can actually consume 63 fewer or more bytes in ZSTD_cwksp_estimated_space_within_bounds()