From 6d82b38188eaeb8a933377c78680071b660fcec2 Mon Sep 17 00:00:00 2001 From: RealTimeChris <40668522+RealTimeChris@users.noreply.github.com> Date: Tue, 3 Dec 2024 01:49:27 -0500 Subject: [PATCH] DiscordCoreAPI v2.0.9 --- Include/discordcoreapi/JsonSpecializations.hpp | 11 ++++++----- Vcpkg/ports/discordcoreapi/portfile.cmake | 15 +++++++++++++-- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/Include/discordcoreapi/JsonSpecializations.hpp b/Include/discordcoreapi/JsonSpecializations.hpp index bac3ebcd8..28c3e3213 100644 --- a/Include/discordcoreapi/JsonSpecializations.hpp +++ b/Include/discordcoreapi/JsonSpecializations.hpp @@ -75,8 +75,9 @@ namespace jsonifier_internal { } }; - template struct parse_impl { - JSONIFIER_ALWAYS_INLINE static void impl(value_type& value, parse_context_type& context) noexcept { + template + struct parse_impl { + DCA_ALWAYS_INLINE static void impl(value_type& value, parse_context_type& context) noexcept { jsonifier::raw_json_data newString{}; parse::impl(newString, context); if (newString.getType() == jsonifier::json_type::String) { @@ -98,9 +99,9 @@ namespace jsonifier_internal { } }; - template - struct parse_impl { - JSONIFIER_ALWAYS_INLINE static void impl(value_type& value, parse_context_type& context) noexcept { + template + struct parse_impl { + DCA_ALWAYS_INLINE static void impl(value_type& value, parse_context_type& context) noexcept { jsonifier::raw_json_data newString{}; parse::impl(newString, context); if (newString.getType() == jsonifier::json_type::String) { diff --git a/Vcpkg/ports/discordcoreapi/portfile.cmake b/Vcpkg/ports/discordcoreapi/portfile.cmake index 7a2585a05..60facec7b 100644 --- a/Vcpkg/ports/discordcoreapi/portfile.cmake +++ b/Vcpkg/ports/discordcoreapi/portfile.cmake @@ -6,10 +6,21 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO RealTimeChris/DiscordCoreAPI REF "v${VERSION}" - SHA512 344e960491e17e9626f6ab4a42f28fe59842c0c15cf32ef2508e850099105667c651feaa6dd642207413fbeac43283310fe2b9a98a2ebfd4a49716da43e5cade + SHA512 f90a5591a8db8fd2f1c0261a6444c00880f707b332d80a5b41aa1115d54455eb3aec1dfe2d9aa201015bc2f25343958d6f7445ba2913a4ba65edc9eaec4570ac HEAD_REF main ) +# discordcoreapi consumes extreme amounts of memory (>9GB per .cpp file). With our default +# concurrency values this causes hanging and/or OOM killing on Linux build machines and +# warnings on the Windows machines like: +# #[warning]Free memory is lower than 5%; Currently used: 99.99% +# #[warning]Free memory is lower than 5%; Currently used: 99.99% +# #[warning]Free memory is lower than 5%; Currently used: 99.99% +# Cut the requested concurrency in quarter to avoid this. +if(VCPKG_CONCURRENCY GREATER 4) + math(EXPR VCPKG_CONCURRENCY "${VCPKG_CONCURRENCY} / 4") +endif() + vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" ) @@ -24,4 +35,4 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") endif() -vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/License.md") +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/License.md") \ No newline at end of file