From 8a92a64a4da612a963a70216c3576fac6886f6a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 5 Sep 2023 13:08:19 +0200 Subject: [PATCH] Platform: add a note about why emscripten_set_window_title() isn't used. --- src/Magnum/Platform/Platform.js.in | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Magnum/Platform/Platform.js.in b/src/Magnum/Platform/Platform.js.in index 2664c3acc..37e78869b 100644 --- a/src/Magnum/Platform/Platform.js.in +++ b/src/Magnum/Platform/Platform.js.in @@ -93,6 +93,15 @@ mergeInto(LibraryManager.library, { stringToUTF8(id, memory, bytes); return memory; }, + /* There's also emscripten_set_window_title(), but this takes an explicit + length, allowing the caller to not need to make a null-terminated copy. + Sized UTF8ToString() is also used everywhere else in our code, which is + better than mixing it with unsized according to Emscripten UTF8ToString() + docs: + + N.B. mixing frequent uses of UTF8ToString() with and without + maxBytesToRead may throw JS JIT optimizations off, so it is worth to + consider consistently using one */ magnumPlatformSetWindowTitle__deps: [ ${MagnumPlatform_EMSCRIPTEN_3135_ONLY} '$UTF8ToString' ],