Skip to content

Commit

Permalink
DiscordCoreAPI v2.0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
RealTimeChris committed Dec 3, 2024
1 parent a6d1022 commit 6d82b38
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
11 changes: 6 additions & 5 deletions Include/discordcoreapi/JsonSpecializations.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ namespace jsonifier_internal {
}
};

template<bool minified, jsonifier::parse_options options, snowflake_t value_type, typename parse_context_type> struct parse_impl<minified, options, value_type, parse_context_type> {
JSONIFIER_ALWAYS_INLINE static void impl(value_type& value, parse_context_type& context) noexcept {
template<bool minified, jsonifier::parse_options options, snowflake_t value_type, typename buffer_type, typename parse_context_type>
struct parse_impl<minified, options, value_type, buffer_type, parse_context_type> {
DCA_ALWAYS_INLINE static void impl(value_type& value, parse_context_type& context) noexcept {
jsonifier::raw_json_data newString{};
parse<minified, options>::impl(newString, context);
if (newString.getType() == jsonifier::json_type::String) {
Expand All @@ -98,9 +99,9 @@ namespace jsonifier_internal {
}
};

template<bool minified, jsonifier::parse_options options, time_stamp_t value_type, typename parse_context_type>
struct parse_impl<minified, options, value_type, parse_context_type> {
JSONIFIER_ALWAYS_INLINE static void impl(value_type& value, parse_context_type& context) noexcept {
template<bool minified, jsonifier::parse_options options, time_stamp_t value_type, typename buffer_type, typename parse_context_type>
struct parse_impl<minified, options, value_type, buffer_type, parse_context_type> {
DCA_ALWAYS_INLINE static void impl(value_type& value, parse_context_type& context) noexcept {
jsonifier::raw_json_data newString{};
parse<minified, options>::impl(newString, context);
if (newString.getType() == jsonifier::json_type::String) {
Expand Down
15 changes: 13 additions & 2 deletions Vcpkg/ports/discordcoreapi/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
)
Expand All @@ -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")

0 comments on commit 6d82b38

Please sign in to comment.