Files
shadowsocks-libev/tests/alloc_audit
Max Lv a22281b1ac C++20 port 12/14: seal the heap, capacity limits (#3078)
* Seal the heap: bounded library heaps and zero-allocation program tests

The programs point libuv, c-ares and Mbed TLS (MBEDTLS_PLATFORM_MEMORY in
the bundled build) at their own FixedHeap before anything runs, mark the
end of startup with heap_seal(), and in verbose mode report heap use and
any allocation after it at exit. The library build keeps the host's
allocator.

measure_alloc.py gains --udp, and the alloc_steady_programs_* tests now
fail on any malloc per relayed TCP connection (by name and by address)
or UDP association, for every cipher family.

* Fix GCC -Wsign-compare errors in the converted C modules

GCC enables -Wsign-compare with -Wall for C++ (clang does not), which
turned a few signed/unsigned comparisons in base64, netutils, server and
manager into errors; udp.cpp needed <ctime>.

* Add --max-connections and --max-udp-sessions

The TCP connection pool and the UDP session table are sized from these
options (or max_connections / max_udp_sessions in the configuration
file) at startup instead of fixed constants; the DNS query pool follows
the connection limit. test_limits.py checks that a connection beyond
the limit is refused and that accepting resumes once one closes.
2026-10-15 10:08:05 +08:00
..