cherry pick guarded sample rate fix

This commit is contained in:
daanx 2025-05-13 15:58:45 -07:00 committed by Daan
parent 8c9f39fde1
commit a479aaba94
6 changed files with 15 additions and 14 deletions

View file

@ -8,7 +8,7 @@ terms of the MIT license. A copy of the license can be found in the file
#ifndef MIMALLOC_H
#define MIMALLOC_H
#define MI_MALLOC_VERSION 307 // major + 2 digits minor
#define MI_MALLOC_VERSION 308 // major + 2 digits minor
// ------------------------------------------------------
// Compiler specific attributes

View file

@ -446,7 +446,6 @@ struct mi_heap_s {
size_t guarded_size_min; // minimal size for guarded objects
size_t guarded_size_max; // maximal size for guarded objects
size_t guarded_sample_rate; // sample rate (set to 0 to disable guarded pages)
size_t guarded_sample_seed; // starting sample count
size_t guarded_sample_count; // current sample count (counting down to 0)
#endif
mi_page_t* pages_free_direct[MI_PAGES_DIRECT]; // optimize: array where every entry points a page with possibly free blocks in the corresponding queue for that size.