Skip to content

Commit 6d82b38

Browse files
committed
DiscordCoreAPI v2.0.9
1 parent a6d1022 commit 6d82b38

File tree

2 files changed

+19
-7
lines changed

2 files changed

+19
-7
lines changed

Include/discordcoreapi/JsonSpecializations.hpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,9 @@ namespace jsonifier_internal {
7575
}
7676
};
7777

78-
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> {
79-
JSONIFIER_ALWAYS_INLINE static void impl(value_type& value, parse_context_type& context) noexcept {
78+
template<bool minified, jsonifier::parse_options options, snowflake_t value_type, typename buffer_type, typename parse_context_type>
79+
struct parse_impl<minified, options, value_type, buffer_type, parse_context_type> {
80+
DCA_ALWAYS_INLINE static void impl(value_type& value, parse_context_type& context) noexcept {
8081
jsonifier::raw_json_data newString{};
8182
parse<minified, options>::impl(newString, context);
8283
if (newString.getType() == jsonifier::json_type::String) {
@@ -98,9 +99,9 @@ namespace jsonifier_internal {
9899
}
99100
};
100101

101-
template<bool minified, jsonifier::parse_options options, time_stamp_t value_type, typename parse_context_type>
102-
struct parse_impl<minified, options, value_type, parse_context_type> {
103-
JSONIFIER_ALWAYS_INLINE static void impl(value_type& value, parse_context_type& context) noexcept {
102+
template<bool minified, jsonifier::parse_options options, time_stamp_t value_type, typename buffer_type, typename parse_context_type>
103+
struct parse_impl<minified, options, value_type, buffer_type, parse_context_type> {
104+
DCA_ALWAYS_INLINE static void impl(value_type& value, parse_context_type& context) noexcept {
104105
jsonifier::raw_json_data newString{};
105106
parse<minified, options>::impl(newString, context);
106107
if (newString.getType() == jsonifier::json_type::String) {

Vcpkg/ports/discordcoreapi/portfile.cmake

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,21 @@ vcpkg_from_github(
66
OUT_SOURCE_PATH SOURCE_PATH
77
REPO RealTimeChris/DiscordCoreAPI
88
REF "v${VERSION}"
9-
SHA512 344e960491e17e9626f6ab4a42f28fe59842c0c15cf32ef2508e850099105667c651feaa6dd642207413fbeac43283310fe2b9a98a2ebfd4a49716da43e5cade
9+
SHA512 f90a5591a8db8fd2f1c0261a6444c00880f707b332d80a5b41aa1115d54455eb3aec1dfe2d9aa201015bc2f25343958d6f7445ba2913a4ba65edc9eaec4570ac
1010
HEAD_REF main
1111
)
1212

13+
# discordcoreapi consumes extreme amounts of memory (>9GB per .cpp file). With our default
14+
# concurrency values this causes hanging and/or OOM killing on Linux build machines and
15+
# warnings on the Windows machines like:
16+
# #[warning]Free memory is lower than 5%; Currently used: 99.99%
17+
# #[warning]Free memory is lower than 5%; Currently used: 99.99%
18+
# #[warning]Free memory is lower than 5%; Currently used: 99.99%
19+
# Cut the requested concurrency in quarter to avoid this.
20+
if(VCPKG_CONCURRENCY GREATER 4)
21+
math(EXPR VCPKG_CONCURRENCY "${VCPKG_CONCURRENCY} / 4")
22+
endif()
23+
1324
vcpkg_cmake_configure(
1425
SOURCE_PATH "${SOURCE_PATH}"
1526
)
@@ -24,4 +35,4 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
2435
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
2536
endif()
2637

27-
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/License.md")
38+
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/License.md")

0 commit comments

Comments
 (0)