Repository navigation
Update libdatachannel to 0.24.6 and isolate native dependencies - #3
Merged
Merged
Conversation
toaster0123
force-pushed
the
fix/native-0246-and-fork-corrections
branch
from
October 26, 2026 13:45
95be8b5 to
d08fdfe
Compare
toaster0123
marked this pull request as ready for review
October 26, 2026 14:09
toaster0123
force-pushed
the
fix/native-0246-and-fork-corrections
branch
2 times, most recently
from
October 26, 2026 15:09
dbced2d to
1f65912
Compare
toaster0123
force-pushed
the
fix/native-0246-and-fork-corrections
branch
from
October 26, 2026 16:05
1f65912 to
09f6589
Compare
toaster0123
force-pushed
the
fix/native-0246-and-fork-corrections
branch
12 times, most recently
from
October 27, 2026 01:39
a721929 to
4118090
Compare
toaster0123
force-pushed
the
fix/native-0246-and-fork-corrections
branch
from
October 27, 2026 01:58
4118090 to
a2fc4df
Compare
toaster0123
force-pushed
the
fix/native-0246-and-fork-corrections
branch
from
October 27, 2026 02:18
a2fc4df to
4a49ce0
Compare
toaster0123
force-pushed
the
fix/native-0246-and-fork-corrections
branch
from
October 27, 2026 09:19
33f8834 to
945a116
Compare
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.
Update the native pin to official libdatachannel v0.24.6 and use published Native Bootstrap 0.1.2. Preserve the binding's MPL-2.0 license and original attribution while correcting Maven metadata and fork URLs.
Desktop JNI embeds private static OpenSSL, secure mimalloc 2.5.2 (SHA-256-pinned) and the C++ runtime. JNI, libdatachannel message buffers, libjuice, usrsctp, C++ new/delete and out-of-line C++ runtime allocations use the same private heap. OpenSSL memory callbacks are installed before initialization; failure prevents loading. macOS builds static LLVM libc++/libc++abi 20.1.8 from hash-verified official archives. Linux and MinGW embed the toolchain's static GNU C++ runtime. MinGW CRT heap calls and import-address references resolve to private definitions at link time; no process import table is patched. The corresponding runtime notices, including Winpthreads MIT/BSD notices on MinGW, are included without changing the binding's license.
Mimalloc uses MI_SECURE=ON and MI_USE_CXX=ON to retain std::bad_alloc and nothrow semantics. Linux uses local-dynamic TLS for JVM loading. MinGW selects mimalloc's supported FLS lifecycle to avoid duplicate allocator initialization with MSVCRT; configuration verifies the actual mimalloc target definition. Only JNI entry points and the existing JVM helper are public. No process allocator hooks, DYLD interposition, malloc-zone replacement, Windows CRT redirection or allocator sidecars are enabled. Java setAllocator retains its application-buffer role; platform-owned results retain their matching release APIs. Build-directory RPATHs are disabled. The forced C preamble preserves Windows rand_s declarations used by SCTP.
Android and iOS do not compile or link mimalloc and report passthrough. iOS retains private OpenSSL in one xcframework; metadata must declare privateOpenSSL=true and allocator=platform. Verification rejects mimalloc definitions and references even when local in an iOS archive, and definitions in Android JNI. Desktop verification rejects shared C++ runtimes, shared allocator/crypto dependencies, non-JNI exports and Linux static TLS.
Preserve reliability settings and numeric ICE bind addresses. Detach library-owned JNI threads before Darwin clears HotSpot state while retaining Java-owned attachments. Windows uses an owned FLS slot instead of MinGW DLL_THREAD_DETACH destructors, avoiding a loader-lock/JVM-safepoint deadlock; tracking is unregistered after native workers stop. JNI owns its Windows DLL entry point. Package dependency notices and corresponding sources with revisions/file hashes; release publication requires clean sources. Resolve prebuilt paths relative to the Gradle project and explicitly assemble selected Mac/iOS classifiers in CI.
A dedicated Allocator diagnostics workflow instruments only desktop JNI test builds on Linux, Windows, macOS ARM64 and Intel. It uses mimalloc's tracking macros to count actual allocation/free events and validate pointer ownership during initialization, component probes, repeated bidirectional DTLS transfers (64 bytes to 64 KiB), four concurrent peer pairs and native cleanup. Separate-process negative controls must reject a JVM-owned pointer and a genuinely compiled system-malloc library. A final-binary audit rejects external C heap, allocating-formatting and C++ allocation imports. Each job then rebuilds and runs the ordinary suite without instrumentation, verifies the diagnostic JNI methods disappear and uploads JSONL counters/import audits. No global allocator hook is installed. This audit found libc++'s macOS asprintf_l fallback; its result now uses the private heap, with a high-precision numeric-formatting regression. Diagnostic scope and limits are documented in docs/native-allocator-diagnostics.md.
Six logical commits are retained, all authored and committed by Toaster.
Validation: