Repository navigation
webserver: guard heap trim behind glibc (Windows build fix) - #288
Merged
Merged
Conversation
malloc_trim, sysconf(_SC_PAGESIZE) and /proc/self/statm are glibc-only. Without a guard the MinGW build failed on three undeclared names (webserver_plugin.cpp:689,700), so Windows Release went red on the master commit that carried the trim. The guard sits on the include and on the function body. The option stays in the interface so one config works on every platform, but where the trim cannot run the plugin says so once at startup and disables it, instead of logging 'heap trim every 60 s' and doing nothing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Что
#287добавилheap trim—malloc_trim(0),sysconf(_SC_PAGESIZE)и/proc/self/statm. Всё три — glibc-специфичны, и Windows Release покраснел на master723e1bb:Как
#if defined(__GLIBC__)стоит и на include, и на теле функции: на MinGW/MSVC нет ни одной из трёх зависимостей.--webserver-heap-trim-secостаётся в интерфейсе (общий конфиг на все платформы), но где trim не может работать — плагин говорит об этом один раз при старте и выключает его, а не печатает «heap trim every 60 s» и молчит впустую.-fsyntax-only,nice -n 19 ionice -c3, rc 0), и боевые четыре узла уже сутки живут на этом коде — в логе api.viz.worldreleased 198 MiB (rss 326 -> 128 MiB).Зачем это отдельным PR
Мастер сейчас несёт сломанную Windows-сборку. Фикс маленький и его надо влить, чтобы Windows Release снова стала зелёной.
🤖 Generated with Claude Code