mirror of
https://github.com/google/brotli.git
synced 2024-11-24 20:40:13 +00:00
tune memory manager for BROTLI_EXPERIMENTAL
PiperOrigin-RevId: 560703386
This commit is contained in:
parent
c1bd196833
commit
e7313b0c4e
@ -1836,15 +1836,8 @@ BROTLI_BOOL BrotliEncoderAttachPreparedDictionary(BrotliEncoderState* state,
|
||||
size_t BrotliEncoderEstimatePeakMemoryUsage(int quality, int lgwin,
|
||||
size_t input_size) {
|
||||
BrotliEncoderParams params;
|
||||
size_t memory_manager_slots = 0;
|
||||
size_t memory_manager_size = 0;
|
||||
#if !defined(BROTLI_ENCODER_EXIT_ON_OOM)
|
||||
memory_manager_slots = 256;
|
||||
#if defined(BROTLI_EXPERIMENTAL)
|
||||
memory_manager_slots = 32768;
|
||||
#endif /* BROTLI_EXPERIMENTAL */
|
||||
#endif /* BROTLI_ENCODER_EXIT_ON_OOM */
|
||||
memory_manager_size = memory_manager_slots * sizeof(void*);
|
||||
size_t memory_manager_slots = BROTLI_ENCODER_MEMORY_MANAGER_SLOTS;
|
||||
size_t memory_manager_size = memory_manager_slots * sizeof(void*);
|
||||
BrotliEncoderInitParams(¶ms);
|
||||
params.quality = quality;
|
||||
params.lgwin = lgwin;
|
||||
|
@ -26,10 +26,12 @@ extern "C" {
|
||||
|
||||
#if !defined(BROTLI_ENCODER_EXIT_ON_OOM)
|
||||
#if defined(BROTLI_EXPERIMENTAL)
|
||||
#define BROTLI_ENCODER_MEMORY_MANAGER_SLOTS 32768
|
||||
#define BROTLI_ENCODER_MEMORY_MANAGER_SLOTS (48*1024)
|
||||
#else /* BROTLI_EXPERIMENTAL */
|
||||
#define BROTLI_ENCODER_MEMORY_MANAGER_SLOTS 256
|
||||
#endif /* BROTLI_EXPERIMENTAL */
|
||||
#else /* BROTLI_ENCODER_EXIT_ON_OOM */
|
||||
#define BROTLI_ENCODER_MEMORY_MANAGER_SLOTS 0
|
||||
#endif /* BROTLI_ENCODER_EXIT_ON_OOM */
|
||||
|
||||
typedef struct MemoryManager {
|
||||
|
Loading…
Reference in New Issue
Block a user