From 730ab5b054b57c11e227ba65ae8cac0a8a024620 Mon Sep 17 00:00:00 2001 From: R Date: Wed, 18 Nov 2026 12:27:10 -0300 Subject: [PATCH 1/2] guidelines: a page relay's embind strings stay, as the owner decided, and its resolution allocates nothing, which webcpp::asio's page resolver now holds in place Chapter 19 no longer lists the page relay's allocations outside the room's resource as an open question; trystero's rule on what stays outside the resources says what stays and why. --- CODING-GUIDELINES.md | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/CODING-GUIDELINES.md b/CODING-GUIDELINES.md index b10faaf..4768193 100644 --- a/CODING-GUIDELINES.md +++ b/CODING-GUIDELINES.md @@ -6648,15 +6648,17 @@ makes a room read, through webcpp::beast's bounded handshake layer. header line in the room's resource, and no byte of a refusal's body, the verify callback and its copy of the host, the waits of Beast's timers and each keep-alive ping's frame), where in a page the stream's state is in - the room's resource; in a page, for each relay connection, the results of - webcpp::asio's page resolver, and the strings embind makes of each event's + the room's resource; in a page, the strings embind makes of each event's type, two for a message; Emscripten's `select()`, Asyncify's unwind data when the run suspends, and the storage of the map in which webcpp::asio's bridge finds each pending Web Crypto promise.** They belong to a dependency or to Asio, and webcpp::webrtc's posts from libdatachannel's - threads may not touch a resource used only on the executor; and removing - a page relay's needs a change to webcpp::beast's page stream and to - webcpp::asio's page resolver (chapter 19). + threads may not touch a resource used only on the executor. A page + relay's embind strings stay, as the owner decided: each is freed at once, + and avoiding them needs webcpp::beast's page stream to read an event's + type without a `std::string`. webcpp::asio's page resolver holds its + results' one entry in place, so that a page relay's resolution allocates + nothing. Source: `doc/allocation.adoc` (libs/trystero). - **No check catches a resource that ends too early: it is declared before the `io_context`, and its lifetime is the user's.** trystero holds a raw pointer @@ -9825,18 +9827,6 @@ owners. both failing closed today; and natively, a deadline on the resolution of a relay's name, which has none (the system's resolver on Asio's resolver thread). -- **trystero, a page relay's allocations outside the room's resource.** In a - page webcpp::beast's stream reads, through embind, the type of each event - of the page's `WebSocket` into a `std::string` (`deliver`), and a - message's data type into another (`receive_message`), each a C library - allocation: two for each message a relay sends, one each for its open and - its close; and - webcpp::asio's page resolver makes its results with `new`, three for each - connection, five for a host longer than 10 bytes. trystero's - `doc/allocation.adoc` lists them, and `platform_page_relay_allocation` - counts exactly these; removing them needs a change to webcpp::beast's page - stream and to webcpp::asio's page resolver, which the owner has not - decided. - **trystero, document's cost.** As WP7 measured it, natively at `-O2` and before document took an allocator, document reads a relay's event in about 12 us, where Boost.JSON took 1.6 us, and the chat's debug From 632a8c712c24cd7e8f90a14d72992de73670b617 Mon Sep 17 00:00:00 2001 From: R Date: Wed, 18 Nov 2026 14:53:22 -0300 Subject: [PATCH 2/2] libs/asio, libs/document, libs/trystero: their mains, where a page's resolver results hold their one entry in place and the guide drops the MSVC STL's debug proxies asio's page resolver allocates nothing for its results (webcpporg/asio#7); trystero's page relay allocation test expects no allocation at a connection's open (webcpporg/trystero#7); document's guide no longer explains the MSVC STL's debug proxies (webcpporg/document#4). --- libs/asio | 2 +- libs/document | 2 +- libs/trystero | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/asio b/libs/asio index 3569dc4..c865be0 160000 --- a/libs/asio +++ b/libs/asio @@ -1 +1 @@ -Subproject commit 3569dc4276f871828c1e5ad397fe5c31ee9d6d85 +Subproject commit c865be042fbfd1e1685a16275bcdc998bf9c96b4 diff --git a/libs/document b/libs/document index b9d9e4f..284ac01 160000 --- a/libs/document +++ b/libs/document @@ -1 +1 @@ -Subproject commit b9d9e4f9002afc93c57dbeac41a3932d49f5af48 +Subproject commit 284ac01954898425fd4bd56881b89f878c86bc98 diff --git a/libs/trystero b/libs/trystero index 08b9b00..ec8e026 160000 --- a/libs/trystero +++ b/libs/trystero @@ -1 +1 @@ -Subproject commit 08b9b007994d9b1773054b9d7108a835855bd8d8 +Subproject commit ec8e026d63427dd6301d900267fff66e85dee9d6