summaryrefslogtreecommitdiff
path: root/thirdparty/zstd/compress/zstd_cwksp.h
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-09-18 21:38:36 +0200
committerRémi Verschelde <rverschelde@gmail.com>2020-09-18 21:47:12 +0200
commit914591c9ae2676f7c39bfd65277471cd02f3a85f (patch)
tree0fa9ec5fe6e822cdd02a89b1b1476c32c5376b22 /thirdparty/zstd/compress/zstd_cwksp.h
parenta332e2f5b2d4acfda639701d719ff415d73c5d0b (diff)
zstd: Update to upstream version 1.4.5
Diffstat (limited to 'thirdparty/zstd/compress/zstd_cwksp.h')
-rw-r--r--thirdparty/zstd/compress/zstd_cwksp.h16
1 files changed, 3 insertions, 13 deletions
diff --git a/thirdparty/zstd/compress/zstd_cwksp.h b/thirdparty/zstd/compress/zstd_cwksp.h
index fc9765bd3f..a25c9263b7 100644
--- a/thirdparty/zstd/compress/zstd_cwksp.h
+++ b/thirdparty/zstd/compress/zstd_cwksp.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-present, Yann Collet, Facebook, Inc.
+ * Copyright (c) 2016-2020, Yann Collet, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under both the BSD-style license (found in the
@@ -14,7 +14,7 @@
/*-*************************************
* Dependencies
***************************************/
-#include "zstd_internal.h"
+#include "../common/zstd_internal.h"
#if defined (__cplusplus)
extern "C" {
@@ -24,16 +24,6 @@ extern "C" {
* Constants
***************************************/
-/* define "workspace is too large" as this number of times larger than needed */
-#define ZSTD_WORKSPACETOOLARGE_FACTOR 3
-
-/* when workspace is continuously too large
- * during at least this number of times,
- * context's memory usage is considered wasteful,
- * because it's sized to handle a worst case scenario which rarely happens.
- * In which case, resize it down to free some memory */
-#define ZSTD_WORKSPACETOOLARGE_MAXDURATION 128
-
/* Since the workspace is effectively its own little malloc implementation /
* arena, when we run under ASAN, we should similarly insert redzones between
* each internal element of the workspace, so ASAN will catch overruns that
@@ -468,7 +458,7 @@ MEM_STATIC void ZSTD_cwksp_init(ZSTD_cwksp* ws, void* start, size_t size) {
MEM_STATIC size_t ZSTD_cwksp_create(ZSTD_cwksp* ws, size_t size, ZSTD_customMem customMem) {
void* workspace = ZSTD_malloc(size, customMem);
DEBUGLOG(4, "cwksp: creating new workspace with %zd bytes", size);
- RETURN_ERROR_IF(workspace == NULL, memory_allocation);
+ RETURN_ERROR_IF(workspace == NULL, memory_allocation, "NULL pointer!");
ZSTD_cwksp_init(ws, workspace, size);
return 0;
}