feat: add bytes.indexOf, server.acceptBatch, server.pendingCount, stdin data callback, and coverage/valgrind make targets

Implement `bytesIndexOf` foreign function supporting optional start offset for searching byte sequences. Add `serverAcceptBatch` and `serverPendingCount` to net module for batch accepting connections and querying pending queue size. Refactor `stdinFileTimerCallback` to pass read bytes to Wren callback instead of null, with separate handling for EOF. Introduce `coverage_64bit` build config with gcov flags, plus `coverage`, `valgrind`, `clean-coverage`, and `publish` phony targets in Makefile. Fix memory leak in regex by nullifying freed pointers on allocation failure.
This commit is contained in:
2026-01-26 11:29:25 +00:00
parent 62b60cce36
commit 38de4da87d
24 changed files with 392 additions and 74 deletions
+28 -1
View File
@@ -1,6 +1,6 @@
# retoor <retoor@molodetz.nl>
.PHONY: build tests clean debug sync-sidebar buildmanual wasm wasm-clean install-emscripten
.PHONY: build tests clean debug sync-sidebar buildmanual wasm wasm-clean install-emscripten coverage valgrind clean-coverage
build:
cd projects/make && $(MAKE) -f wren_cli.make -j $$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 4)
@@ -26,6 +26,14 @@ install:
clean:
cd projects/make && $(MAKE) -f wren_cli.make clean
publish:
git add src
git add example
git add manual_src
git add test
git commit -a -m "Update."
git push
wasm-clean:
cd projects/make.wasm && $(MAKE) -f wren_wasm.make clean
@@ -50,3 +58,22 @@ wasm:
buildmanual:
python3 util/build_manual.py
coverage:
cd projects/make && $(MAKE) -f wren_cli.make config=coverage_64bit clean
cd projects/make && $(MAKE) -f wren_cli.make config=coverage_64bit -j $$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 4)
python3 util/test.py --suffix=_cov
@echo "Generating coverage report..."
lcov --capture --directory projects/make/obj/64bit/Coverage --output-file coverage.info --ignore-errors mismatch,inconsistent
lcov --remove coverage.info '/usr/*' '*/deps/*' --output-file coverage.info --ignore-errors unused
genhtml coverage.info --output-directory coverage_report
@echo "Coverage report: coverage_report/index.html"
valgrind:
cd projects/make && $(MAKE) -f wren_cli.make config=debug_64bit -j $$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 4)
python3 util/test.py --suffix=_d --valgrind
clean-coverage:
rm -rf coverage.info coverage_report
find projects/make -name "*.gcda" -delete
find projects/make -name "*.gcno" -delete