From 72b9348f023479b7d9afb4b7c2c8a666e82ff7a8 Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Mon, 12 Sep 2022 18:34:48 -0700 Subject: Clarifiy documentation for LZ4F_HEAPMODE Now it's only about LZ4F_compressFrame(), and it's only about the Compression Context (not the hash tables, which used to be integrated). --- lib/README.md | 4 +++- lib/lz4frame.c | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/README.md b/lib/README.md index 08d1cef..94e0161 100644 --- a/lib/README.md +++ b/lib/README.md @@ -100,7 +100,7 @@ The following build macro can be selected to adjust source code behavior at comp passed as argument to become a compression state is suitably aligned. This test can be disabled if it proves flaky, by setting this value to 0. -- `LZ4_USER_MEMORY_FUNCTIONS` : replace calls to ``'s `malloc()`, `calloc()` and `free()` +- `LZ4_USER_MEMORY_FUNCTIONS` : replace calls to ``'s `malloc()`, `calloc()` and `free()` by user-defined functions, which must be named `LZ4_malloc()`, `LZ4_calloc()` and `LZ4_free()`. User functions must be available at link time. @@ -115,6 +115,8 @@ The following build macro can be selected to adjust source code behavior at comp (embedded, bootloader, etc). For more details, see description of this macro in `lib/lz4.h`. +- `LZ4F_HEAPMODE` : selects how `LZ4F_compressFrame()` allocates the compression state, + either on stack (default, value 0) or using heap memory (value 1). #### Amalgamation diff --git a/lib/lz4frame.c b/lib/lz4frame.c index b4caff4..4d991e1 100644 --- a/lib/lz4frame.c +++ b/lib/lz4frame.c @@ -54,8 +54,8 @@ **************************************/ /* * LZ4F_HEAPMODE : - * Select how default compression functions will allocate memory for their hash table, - * in memory stack (0:default, fastest), or in memory heap (1:requires malloc()). + * Select how LZ4F_compressFrame will allocate the Compression Context, + * either on stack (0:default, fastest), or in memory heap (1:requires malloc()). */ #ifndef LZ4F_HEAPMODE # define LZ4F_HEAPMODE 0 -- cgit v0.12