aboutsummaryrefslogtreecommitdiff
path: root/c/enc/memory.h
diff options
context:
space:
mode:
Diffstat (limited to 'c/enc/memory.h')
-rw-r--r--c/enc/memory.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/c/enc/memory.h b/c/enc/memory.h
index cbe4e30..9dbed55 100644
--- a/c/enc/memory.h
+++ b/c/enc/memory.h
@@ -24,6 +24,14 @@ extern "C" {
#define BROTLI_ENCODER_EXIT_ON_OOM
#endif
+#if !defined(BROTLI_ENCODER_EXIT_ON_OOM)
+#if defined(BROTLI_EXPERIMENTAL)
+#define BROTLI_ENCODER_MEMORY_MANAGER_SLOTS 6144
+#else /* BROTLI_EXPERIMENTAL */
+#define BROTLI_ENCODER_MEMORY_MANAGER_SLOTS 256
+#endif /* BROTLI_EXPERIMENTAL */
+#endif /* BROTLI_ENCODER_EXIT_ON_OOM */
+
typedef struct MemoryManager {
brotli_alloc_func alloc_func;
brotli_free_func free_func;
@@ -33,7 +41,7 @@ typedef struct MemoryManager {
size_t perm_allocated;
size_t new_allocated;
size_t new_freed;
- void* pointers[256];
+ void* pointers[BROTLI_ENCODER_MEMORY_MANAGER_SLOTS];
#endif /* BROTLI_ENCODER_EXIT_ON_OOM */
} MemoryManager;