From c3cfc125236258ef640cd2bfb7d9c4b9a63ef4e2 Mon Sep 17 00:00:00 2001 From: Kyon Date: Fri, 23 Oct 2026 06:25:51 +0200 Subject: [PATCH] fix(libSceJson2): implement constructor and destructor variants --- core/libs/prx/libSceJson2/CMakeLists.txt | 7 +- core/libs/prx/libSceJson2/Export.cpp | 41 +++- .../libs/prx/libSceJson2/InventoryExports.cpp | 170 --------------- core/libs/tests/GuestJsonAliases.cpp | 204 ++++++++++++++++++ docs/dev/debt/libSceJson2.md | 34 --- 5 files changed, 249 insertions(+), 207 deletions(-) create mode 100644 core/libs/tests/GuestJsonAliases.cpp diff --git a/core/libs/prx/libSceJson2/CMakeLists.txt b/core/libs/prx/libSceJson2/CMakeLists.txt index 722cd23d32..c6547a41ed 100644 --- a/core/libs/prx/libSceJson2/CMakeLists.txt +++ b/core/libs/prx/libSceJson2/CMakeLists.txt @@ -4,6 +4,11 @@ target_include_directories(libSceJson2 PRIVATE ${LIBS_INCLUDE_DIR}) configure_windows_unwind(libSceJson2) if(BUILD_TESTING) + add_test_executable(guest_json_alias_tests ${LIBS_INCLUDE_DIR}/tests/GuestJsonAliases.cpp) + target_include_directories(guest_json_alias_tests PRIVATE ${LIBS_INCLUDE_DIR}) + target_link_libraries(guest_json_alias_tests PRIVATE libSceJson2 libc) + configure_windows_unwind(guest_json_alias_tests) + add_test(NAME guest_json_aliases COMMAND guest_json_alias_tests) add_test_executable(guest_json_tests ${LIBS_INCLUDE_DIR}/tests/GuestJson.cpp) target_include_directories(guest_json_tests PRIVATE ${LIBS_INCLUDE_DIR}) target_link_libraries(guest_json_tests PRIVATE libSceJson2 libc) @@ -91,7 +96,7 @@ if(BUILD_TESTING) ENVIRONMENT "LOCPATH=${numeric_locale_dir}") endif() if(WIN32) - set_tests_properties(guest_json guest_json_parser_state guest_json_numeric_locale guest_json_float_settings guest_json_allocator_settings guest_json_value_layout guest_json_value_ownership guest_json_special_float guest_json_element_recovery guest_json_null_recovery guest_json_global_recovery guest_json_string_allocator guest_json_array_allocator guest_json_object_allocator guest_json_value_allocator guest_json_allocator PROPERTIES ENVIRONMENT_MODIFICATION + set_tests_properties(guest_json guest_json_aliases guest_json_parser_state guest_json_numeric_locale guest_json_float_settings guest_json_allocator_settings guest_json_value_layout guest_json_value_ownership guest_json_special_float guest_json_element_recovery guest_json_null_recovery guest_json_global_recovery guest_json_string_allocator guest_json_array_allocator guest_json_object_allocator guest_json_value_allocator guest_json_allocator PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$;PATH=path_list_prepend:$;PATH=path_list_prepend:$") endif() endif() diff --git a/core/libs/prx/libSceJson2/Export.cpp b/core/libs/prx/libSceJson2/Export.cpp index 8be4b4b071..3f308334b1 100644 --- a/core/libs/prx/libSceJson2/Export.cpp +++ b/core/libs/prx/libSceJson2/Export.cpp @@ -2383,13 +2383,15 @@ void APS5_VABI _ZN3sce4Json5ValueC1El(Value* self, std::int64_t value) { Constru void APS5_VABI _ZN3sce4Json5ValueC1Em(Value* self, std::uint64_t value) { Construct(*self); self->type = TypeUInteger; self->uinteger = value; } void APS5_VABI _ZN3sce4Json5ValueC1Ed(Value* self, double value) { Construct(*self); AssignReal(*self, value); } void APS5_VABI _ZN3sce4Json5ValueC1EPKc(Value* self, const char* text) { - if (text == nullptr) throw std::invalid_argument("sce::Json::Value: null text"); Construct(*self); + ScopedString temporary{std::string_view{text ? text : ""}}; + if (!temporary.string.text) return; SetType(*self, TypeString); - if (self->type == TypeString) AssignText(*self->string, text); + if (self->type == TypeString) AssignText(*self->string, View(temporary.string), true); } void APS5_VABI _ZN3sce4Json5ValueC1ERKNS0_6StringE(Value* self, const String* text) { Construct(*self); + if (!text->text) return; SetType(*self, TypeString); if (self->type == TypeString) AssignText(*self->string, View(*text), true); } @@ -2849,4 +2851,39 @@ void APS5_VABI _ZN3sce4Json6Object4PairC1Ev(Pair* self) { *self = pair; BindChildren(self->value); } + +void APS5_VABI _ZN3sce4Json11InitializerC2Ev(void* self) { _ZN3sce4Json11InitializerC1Ev(self); } +void APS5_VABI _ZN3sce4Json11InitializerD2Ev(void* self) { _ZN3sce4Json11InitializerD1Ev(self); } +void APS5_VABI _ZN3sce4Json17InitParameterRttiC2EPNS0_14AllocParamRttiEPvm(InitParameterRtti* self, void* allocParam, void* userData, std::size_t fileBufferSize) { _ZN3sce4Json17InitParameterRttiC1EPNS0_14AllocParamRttiEPvm(self, allocParam, userData, fileBufferSize); } +void APS5_VABI _ZN3sce4Json5Array8iteratorC2ERKS2_(ArrayIterator* self, const ArrayIterator* other) { _ZN3sce4Json5Array8iteratorC1ERKS2_(self, other); } +void APS5_VABI _ZN3sce4Json5Array8iteratorC2Ev(ArrayIterator* self) { _ZN3sce4Json5Array8iteratorC1Ev(self); } +void APS5_VABI _ZN3sce4Json5Array8iteratorD2Ev(ArrayIterator* self) { _ZN3sce4Json5Array8iteratorD1Ev(self); } +void APS5_VABI _ZN3sce4Json5ArrayC2ERKS1_(Array* self, const Array* other) { _ZN3sce4Json5ArrayC1ERKS1_(self, other); } +void APS5_VABI _ZN3sce4Json5ArrayC2Ev(Array* self) { _ZN3sce4Json5ArrayC1Ev(self); } +void APS5_VABI _ZN3sce4Json5ArrayD2Ev(Array* self) { _ZN3sce4Json5ArrayD1Ev(self); } +void APS5_VABI _ZN3sce4Json5ValueC2ENS0_9ValueTypeE(Value* self, ValueType type) { _ZN3sce4Json5ValueC1ENS0_9ValueTypeE(self, type); } +void APS5_VABI _ZN3sce4Json5ValueC2EPKc(Value* self, const char* text) { _ZN3sce4Json5ValueC1EPKc(self, text); } +void APS5_VABI _ZN3sce4Json5ValueC2ERKNS0_5ArrayE(Value* self, const Array* array) { _ZN3sce4Json5ValueC1ERKNS0_5ArrayE(self, array); } +void APS5_VABI _ZN3sce4Json5ValueC2ERKNS0_6ObjectE(Value* self, const Object* object) { _ZN3sce4Json5ValueC1ERKNS0_6ObjectE(self, object); } +void APS5_VABI _ZN3sce4Json5ValueC2ERKNS0_6StringE(Value* self, const String* text) { _ZN3sce4Json5ValueC1ERKNS0_6StringE(self, text); } +void APS5_VABI _ZN3sce4Json5ValueC2ERKS1_(Value* self, const Value* other) { _ZN3sce4Json5ValueC1ERKS1_(self, other); } +void APS5_VABI _ZN3sce4Json5ValueC2Eb(Value* self, bool value) { _ZN3sce4Json5ValueC1Eb(self, value); } +void APS5_VABI _ZN3sce4Json5ValueC2Ed(Value* self, double value) { _ZN3sce4Json5ValueC1Ed(self, value); } +void APS5_VABI _ZN3sce4Json5ValueC2El(Value* self, std::int64_t value) { _ZN3sce4Json5ValueC1El(self, value); } +void APS5_VABI _ZN3sce4Json5ValueC2Em(Value* self, std::uint64_t value) { _ZN3sce4Json5ValueC1Em(self, value); } +void APS5_VABI _ZN3sce4Json5ValueC2Ev(Value* self) { _ZN3sce4Json5ValueC1Ev(self); } +void APS5_VABI _ZN3sce4Json5ValueD2Ev(Value* self) { _ZN3sce4Json5ValueD1Ev(self); } +void APS5_VABI _ZN3sce4Json6Object4PairC2ERKNS0_6StringERKNS0_5ValueE(Pair* self, const String* key, const Value* value) { _ZN3sce4Json6Object4PairC1ERKNS0_6StringERKNS0_5ValueE(self, key, value); } +void APS5_VABI _ZN3sce4Json6Object4PairC2Ev(Pair* self) { _ZN3sce4Json6Object4PairC1Ev(self); } +void APS5_VABI _ZN3sce4Json6Object4PairD2Ev(Pair* self) { _ZN3sce4Json6Object4PairD1Ev(self); } +void APS5_VABI _ZN3sce4Json6Object8iteratorC2ERKS2_(ObjectIterator* self, const ObjectIterator* other) { _ZN3sce4Json6Object8iteratorC1ERKS2_(self, other); } +void APS5_VABI _ZN3sce4Json6Object8iteratorC2Ev(ObjectIterator* self) { _ZN3sce4Json6Object8iteratorC1Ev(self); } +void APS5_VABI _ZN3sce4Json6Object8iteratorD2Ev(ObjectIterator* self) { _ZN3sce4Json6Object8iteratorD1Ev(self); } +void APS5_VABI _ZN3sce4Json6ObjectC2ERKS1_(Object* self, const Object* other) { _ZN3sce4Json6ObjectC1ERKS1_(self, other); } +void APS5_VABI _ZN3sce4Json6ObjectC2Ev(Object* self) { _ZN3sce4Json6ObjectC1Ev(self); } +void APS5_VABI _ZN3sce4Json6ObjectD2Ev(Object* self) { _ZN3sce4Json6ObjectD1Ev(self); } +void APS5_VABI _ZN3sce4Json6StringC2EPKc(String* self, const char* text) { _ZN3sce4Json6StringC1EPKc(self, text); } +void APS5_VABI _ZN3sce4Json6StringC2ERKS1_(String* self, const String* other) { _ZN3sce4Json6StringC1ERKS1_(self, other); } +void APS5_VABI _ZN3sce4Json6StringC2Ev(String* self) { _ZN3sce4Json6StringC1Ev(self); } +void APS5_VABI _ZN3sce4Json6StringD2Ev(String* self) { _ZN3sce4Json6StringD1Ev(self); } } diff --git a/core/libs/prx/libSceJson2/InventoryExports.cpp b/core/libs/prx/libSceJson2/InventoryExports.cpp index 20cbf74dd5..3a2e99ff14 100644 --- a/core/libs/prx/libSceJson2/InventoryExports.cpp +++ b/core/libs/prx/libSceJson2/InventoryExports.cpp @@ -10,16 +10,6 @@ int APS5_VABI _ZN3sce4Json11Initializer24setAllocatorInfoCallBackEPFviNS0_9Value return 0; } -int APS5_VABI _ZN3sce4Json11InitializerC2Ev() { - NotImplemented_nid_no_patch(__func__); - return 0; -} - -int APS5_VABI _ZN3sce4Json11InitializerD2Ev() { - NotImplemented_nid_no_patch(__func__); - return 0; -} - int APS5_VABI _ZN3sce4Json12MemAllocatorD0Ev() { NotImplemented_nid_no_patch(__func__); return 0; @@ -30,11 +20,6 @@ int APS5_VABI _ZN3sce4Json12MemAllocatorD1Ev() { return 0; } -int APS5_VABI _ZN3sce4Json17InitParameterRttiC2EPNS0_14AllocParamRttiEPvm() { - NotImplemented_nid_no_patch(__func__); - return 0; -} - int APS5_VABI _ZN3sce4Json19InternalInitializer19terminate_staticlibEv() { NotImplemented_nid_no_patch(__func__); return 0; @@ -85,41 +70,11 @@ int APS5_VABI _ZN3sce4Json5Array6insertERKNS1_8iteratorERKNS0_5ValueE() { return 0; } -int APS5_VABI _ZN3sce4Json5Array8iteratorC2ERKS2_() { - NotImplemented_nid_no_patch(__func__); - return 0; -} - -int APS5_VABI _ZN3sce4Json5Array8iteratorC2Ev() { - NotImplemented_nid_no_patch(__func__); - return 0; -} - -int APS5_VABI _ZN3sce4Json5Array8iteratorD2Ev() { - NotImplemented_nid_no_patch(__func__); - return 0; -} - int APS5_VABI _ZN3sce4Json5Array8pop_backEv() { NotImplemented_nid_no_patch(__func__); return 0; } -int APS5_VABI _ZN3sce4Json5ArrayC2ERKS1_() { - NotImplemented_nid_no_patch(__func__); - return 0; -} - -int APS5_VABI _ZN3sce4Json5ArrayC2Ev() { - NotImplemented_nid_no_patch(__func__); - return 0; -} - -int APS5_VABI _ZN3sce4Json5ArrayD2Ev() { - NotImplemented_nid_no_patch(__func__); - return 0; -} - int APS5_VABI _ZN3sce4Json5Value11referStringEv() { NotImplemented_nid_no_patch(__func__); return 0; @@ -155,136 +110,11 @@ int APS5_VABI _ZN3sce4Json5Value9serializeERNS0_6StringEPFiS3_PvES4_() { return 0; } -int APS5_VABI _ZN3sce4Json5ValueC2ENS0_9ValueTypeE() { - NotImplemented_nid_no_patch(__func__); - return 0; -} - -int APS5_VABI _ZN3sce4Json5ValueC2EPKc() { - NotImplemented_nid_no_patch(__func__); - return 0; -} - -int APS5_VABI _ZN3sce4Json5ValueC2ERKNS0_5ArrayE() { - NotImplemented_nid_no_patch(__func__); - return 0; -} - -int APS5_VABI _ZN3sce4Json5ValueC2ERKNS0_6ObjectE() { - NotImplemented_nid_no_patch(__func__); - return 0; -} - -int APS5_VABI _ZN3sce4Json5ValueC2ERKNS0_6StringE() { - NotImplemented_nid_no_patch(__func__); - return 0; -} - -int APS5_VABI _ZN3sce4Json5ValueC2ERKS1_() { - NotImplemented_nid_no_patch(__func__); - return 0; -} - -int APS5_VABI _ZN3sce4Json5ValueC2Eb() { - NotImplemented_nid_no_patch(__func__); - return 0; -} - -int APS5_VABI _ZN3sce4Json5ValueC2Ed() { - NotImplemented_nid_no_patch(__func__); - return 0; -} - -int APS5_VABI _ZN3sce4Json5ValueC2El() { - NotImplemented_nid_no_patch(__func__); - return 0; -} - -int APS5_VABI _ZN3sce4Json5ValueC2Em() { - NotImplemented_nid_no_patch(__func__); - return 0; -} - -int APS5_VABI _ZN3sce4Json5ValueC2Ev() { - NotImplemented_nid_no_patch(__func__); - return 0; -} - -int APS5_VABI _ZN3sce4Json5ValueD2Ev() { - NotImplemented_nid_no_patch(__func__); - return 0; -} - int APS5_VABI _ZN3sce4Json6MallocEm() { NotImplemented_nid_no_patch(__func__); return 0; } -int APS5_VABI _ZN3sce4Json6Object4PairC2ERKNS0_6StringERKNS0_5ValueE() { - NotImplemented_nid_no_patch(__func__); - return 0; -} - -int APS5_VABI _ZN3sce4Json6Object4PairC2Ev() { - NotImplemented_nid_no_patch(__func__); - return 0; -} - -int APS5_VABI _ZN3sce4Json6Object4PairD2Ev() { - NotImplemented_nid_no_patch(__func__); - return 0; -} - -int APS5_VABI _ZN3sce4Json6Object8iteratorC2ERKS2_() { - NotImplemented_nid_no_patch(__func__); - return 0; -} - -int APS5_VABI _ZN3sce4Json6Object8iteratorC2Ev() { - NotImplemented_nid_no_patch(__func__); - return 0; -} - -int APS5_VABI _ZN3sce4Json6Object8iteratorD2Ev() { - NotImplemented_nid_no_patch(__func__); - return 0; -} - -int APS5_VABI _ZN3sce4Json6ObjectC2ERKS1_() { - NotImplemented_nid_no_patch(__func__); - return 0; -} - -int APS5_VABI _ZN3sce4Json6ObjectC2Ev() { - NotImplemented_nid_no_patch(__func__); - return 0; -} - -int APS5_VABI _ZN3sce4Json6ObjectD2Ev() { - NotImplemented_nid_no_patch(__func__); - return 0; -} - -int APS5_VABI _ZN3sce4Json6StringC2EPKc() { - NotImplemented_nid_no_patch(__func__); - return 0; -} - -int APS5_VABI _ZN3sce4Json6StringC2ERKS1_() { - NotImplemented_nid_no_patch(__func__); - return 0; -} - -int APS5_VABI _ZN3sce4Json6StringC2Ev() { - NotImplemented_nid_no_patch(__func__); - return 0; -} - -int APS5_VABI _ZN3sce4Json6StringD2Ev() { - NotImplemented_nid_no_patch(__func__); - return 0; -} - int APS5_VABI _ZNK3sce4Json14InitParameter211getUserDataEv() { NotImplemented_nid_no_patch(__func__); return 0; diff --git a/core/libs/tests/GuestJsonAliases.cpp b/core/libs/tests/GuestJsonAliases.cpp new file mode 100644 index 0000000000..1ffa256968 --- /dev/null +++ b/core/libs/tests/GuestJsonAliases.cpp @@ -0,0 +1,204 @@ +#include "prx/libc/include/general/VabiMacros.hpp" +#include +#include +#include +#include +#include +#include +#include +#include + +struct Value { Value* parent; void* auxiliary; std::uint64_t payload; std::uint32_t reserved; std::int32_t type; }; +struct String { void* storage; }; +struct Array { void* storage; }; +struct Object { void* storage; }; +struct Iterator { void* state; }; +struct Pair { String key; std::uint64_t reserved; Value value; }; +struct Parameter { void* allocator; void* context; std::size_t bufferSize; }; +using AliasAllocateCallback = void* (APS5_VABI*)(std::size_t, void*); +using AliasFreeCallback = void (APS5_VABI*)(void*, void*); +using AliasNotifyCallback = void (APS5_VABI*)(int, std::size_t, void*); +struct Callbacks { AliasAllocateCallback allocate; AliasFreeCallback free; AliasNotifyCallback notify; }; +static_assert(sizeof(Value) == 32 && sizeof(Parameter) == 24 && sizeof(Pair) == 48); +extern "C" { +void APS5_VABI _ZN3sce4Json11InitializerC2Ev(void*); +void APS5_VABI _ZN3sce4Json11InitializerD2Ev(void*); +void APS5_VABI _ZN3sce4Json17InitParameterRttiC2EPNS0_14AllocParamRttiEPvm(Parameter*, void*, void*, std::size_t); +void APS5_VABI _ZN3sce4Json5Array8iteratorC2ERKS2_(Iterator*, const Iterator*); +void APS5_VABI _ZN3sce4Json5Array8iteratorC2Ev(Iterator*); +void APS5_VABI _ZN3sce4Json5Array8iteratorD2Ev(Iterator*); +void APS5_VABI _ZN3sce4Json5ArrayC2ERKS1_(Array*, const Array*); +void APS5_VABI _ZN3sce4Json5ArrayC2Ev(Array*); +void APS5_VABI _ZN3sce4Json5ArrayD2Ev(Array*); +void APS5_VABI _ZN3sce4Json5ValueC2ENS0_9ValueTypeE(Value*, std::int32_t); +void APS5_VABI _ZN3sce4Json5ValueC2EPKc(Value*, const char*); +void APS5_VABI _ZN3sce4Json5ValueC2ERKNS0_5ArrayE(Value*, const Array*); +void APS5_VABI _ZN3sce4Json5ValueC2ERKNS0_6ObjectE(Value*, const Object*); +void APS5_VABI _ZN3sce4Json5ValueC2ERKNS0_6StringE(Value*, const String*); +void APS5_VABI _ZN3sce4Json5ValueC2ERKS1_(Value*, const Value*); +void APS5_VABI _ZN3sce4Json5ValueC2Eb(Value*, bool); +void APS5_VABI _ZN3sce4Json5ValueC2Ed(Value*, double); +void APS5_VABI _ZN3sce4Json5ValueC2El(Value*, std::int64_t); +void APS5_VABI _ZN3sce4Json5ValueC2Em(Value*, std::uint64_t); +void APS5_VABI _ZN3sce4Json5ValueC2Ev(Value*); +void APS5_VABI _ZN3sce4Json5ValueD2Ev(Value*); +void APS5_VABI _ZN3sce4Json6Object4PairC2ERKNS0_6StringERKNS0_5ValueE(Pair*, const String*, const Value*); +void APS5_VABI _ZN3sce4Json6Object4PairC2Ev(Pair*); +void APS5_VABI _ZN3sce4Json6Object4PairD2Ev(Pair*); +void APS5_VABI _ZN3sce4Json6Object8iteratorC2ERKS2_(Iterator*, const Iterator*); +void APS5_VABI _ZN3sce4Json6Object8iteratorC2Ev(Iterator*); +void APS5_VABI _ZN3sce4Json6Object8iteratorD2Ev(Iterator*); +void APS5_VABI _ZN3sce4Json6ObjectC2ERKS1_(Object*, const Object*); +void APS5_VABI _ZN3sce4Json6ObjectC2Ev(Object*); +void APS5_VABI _ZN3sce4Json6ObjectD2Ev(Object*); +void APS5_VABI _ZN3sce4Json6StringC2EPKc(String*, const char*); +void APS5_VABI _ZN3sce4Json6StringC2ERKS1_(String*, const String*); +void APS5_VABI _ZN3sce4Json6StringC2Ev(String*); +void APS5_VABI _ZN3sce4Json6StringD2Ev(String*); +int APS5_VABI _ZN3sce4Json11Initializer10initializeEPKNS0_13InitParameterE(void*, const Parameter*); +const char* APS5_VABI _ZNK3sce4Json6String5c_strEv(const String*); +void APS5_VABI _ZN3sce4Json5Array9push_backERKNS0_5ValueE(Array*, const Value*); +const Value* APS5_VABI _ZNK3sce4Json5Array5frontEv(const Array*); +std::size_t APS5_VABI _ZNK3sce4Json5Array4sizeEv(const Array*); +Iterator* APS5_VABI _ZNK3sce4Json5Array5beginEv(Iterator*, const Array*); +Value* APS5_VABI _ZNK3sce4Json5Array8iteratordeEv(const Iterator*); +Iterator* APS5_VABI _ZNK3sce4Json6Object5beginEv(Iterator*, const Object*); +const Pair* APS5_VABI _ZNK3sce4Json6Object8iteratordeEv(const Iterator*); +std::size_t APS5_VABI _ZNK3sce4Json6Object4sizeEv(const Object*); +Value* APS5_VABI _ZN3sce4Json6ObjectixERKNS0_6StringE(Object*, const String*); +void APS5_VABI _ZN3sce4Json5Value3setEl(Value*, std::int64_t); +const Value* APS5_VABI _ZNK3sce4Json5ValueixEPKc(const Value*, const char*); +} +static void Require(bool valid, const char* message) { + if (!valid) { std::fprintf(stderr, "%s\n", message); std::abort(); } +} +struct AliasTrace { + std::map live; + int budget = -1; + bool once = false; + std::size_t requests = 0; + unsigned notifications = 0; +}; +static void* APS5_VABI AllocateAlias(std::size_t size, void* context) { + auto& trace = *static_cast(context); + ++trace.requests; + if (trace.budget == 0) { if (trace.once) trace.budget = -1; return nullptr; } + if (trace.budget > 0) --trace.budget; + void* memory = std::malloc(size); + Require(memory != nullptr, "Alias tracking allocator requires host memory"); + std::memset(memory, 0xa5, size); trace.live.emplace(memory, size); return memory; +} +static void APS5_VABI FreeAlias(void* memory, void* context) { + if (!memory) return; + Require(static_cast(context)->live.erase(memory) == 1, "Alias destruction must free each allocation through its owning context exactly once"); + std::free(memory); +} +static void APS5_VABI NotifyAlias(int error, std::size_t, void* context) { + Require(static_cast(error) == 0x80848102, "Alias allocation failures must retain the Json2 error"); + ++static_cast(context)->notifications; +} +static const String* Text(const Value& value) { return reinterpret_cast(value.payload); } +static void CheckText(const Value& value, const char* expected) { + Require(value.type == 5 && value.payload && std::strcmp(_ZNK3sce4Json6String5c_strEv(Text(value)), expected) == 0, "Value constructor variants must preserve string contents"); +} +int main() { + AliasTrace trace; + Callbacks callbacks{AllocateAlias, FreeAlias, NotifyAlias}; + alignas(8) std::array settings; settings.fill(std::byte{0xa5}); + auto* parameter = reinterpret_cast(settings.data()); + _ZN3sce4Json17InitParameterRttiC2EPNS0_14AllocParamRttiEPvm(parameter, &callbacks, &trace, 8192); + Require(parameter->allocator && parameter->context == &trace && parameter->bufferSize == 8192, "RTTI constructor variant must retain its callbacks, context and buffer setting"); + for (std::size_t i = sizeof(Parameter); i < settings.size(); ++i) Require(settings[i] == std::byte{0xa5}, "RTTI construction must preserve bytes beyond its parameter block"); + std::array initializer; initializer.fill(0xa5); + _ZN3sce4Json11InitializerC2Ev(initializer.data()); + Require(initializer[0] == 0, "Initializer constructor variant must clear its active byte"); + for (std::size_t i = 1; i < initializer.size(); ++i) Require(initializer[i] == 0xa5, "Initializer construction must preserve every adjacent byte"); + Require(_ZN3sce4Json11Initializer10initializeEPKNS0_13InitParameterE(initializer.data(), parameter) == 0, "Initialize through the constructor variant and RTTI allocator"); + const auto baseline = trace.live.size(); + for (std::int32_t type = 0; type < 8; ++type) { + Value value; std::memset(&value, 0xa5, sizeof(value)); + _ZN3sce4Json5ValueC2ENS0_9ValueTypeE(&value, type); + Require(value.type == type && !value.parent && !value.auxiliary && value.reserved == 0xa5a5a5a5, "Typed value constructor variant must retain its type and inactive metadata"); + _ZN3sce4Json5ValueD2Ev(&value); + Require(trace.live.size() == baseline, "Typed constructor/destructor variants must reclaim their handles and storage"); + } + Value value{}; + _ZN3sce4Json5ValueC2Ev(&value); Require(value.type == 0, "Default value constructor variant must construct null"); _ZN3sce4Json5ValueD2Ev(&value); + _ZN3sce4Json5ValueC2Eb(&value, true); Require(value.type == 1 && (value.payload & 255) == 1, "Boolean constructor variant must preserve its payload"); _ZN3sce4Json5ValueD2Ev(&value); + _ZN3sce4Json5ValueC2El(&value, -77); Require(value.type == 2 && value.payload == std::bit_cast(std::int64_t{-77}), "Signed constructor variant must preserve all payload bits"); _ZN3sce4Json5ValueD2Ev(&value); + _ZN3sce4Json5ValueC2Em(&value, UINT64_MAX); Require(value.type == 3 && value.payload == UINT64_MAX, "Unsigned constructor variant must preserve all payload bits"); _ZN3sce4Json5ValueD2Ev(&value); + _ZN3sce4Json5ValueC2Ed(&value, 1.25); Require(value.type == 4 && value.payload == std::bit_cast(1.25), "Real constructor variant must preserve its payload"); _ZN3sce4Json5ValueD2Ev(&value); + String empty{}, text{}, copiedText{}; + _ZN3sce4Json6StringC2Ev(&empty); Require(empty.storage && !*_ZNK3sce4Json6String5c_strEv(&empty), "Default string constructor variant must own empty storage"); + _ZN3sce4Json6StringC2EPKc(&text, "abc"); _ZN3sce4Json6StringC2ERKS1_(&copiedText, &text); + Require(text.storage != copiedText.storage && std::strcmp(_ZNK3sce4Json6String5c_strEv(&copiedText), "abc") == 0, "String copy constructor variant must own independent storage"); + _ZN3sce4Json5ValueC2EPKc(&value, "abc"); CheckText(value, "abc"); + Value copiedValue{}; _ZN3sce4Json5ValueC2ERKS1_(&copiedValue, &value); CheckText(copiedValue, "abc"); + Require(copiedValue.payload != value.payload, "Value copy constructor variant must own an independent handle"); + _ZN3sce4Json5ValueD2Ev(&copiedValue); _ZN3sce4Json5ValueD2Ev(&value); + _ZN3sce4Json5ValueC2ERKNS0_6StringE(&value, &text); CheckText(value, "abc"); + Require(Text(value)->storage != text.storage, "String-to-value constructor variant must copy storage"); _ZN3sce4Json5ValueD2Ev(&value); + Array array{}, copiedArray{}; _ZN3sce4Json5ArrayC2Ev(&array); + _ZN3sce4Json5ValueC2El(&value, 42); _ZN3sce4Json5Array9push_backERKNS0_5ValueE(&array, &value); + _ZN3sce4Json5ArrayC2ERKS1_(&copiedArray, &array); + Require(array.storage != copiedArray.storage && _ZNK3sce4Json5Array4sizeEv(&copiedArray) == 1 && _ZNK3sce4Json5Array5frontEv(&copiedArray)->payload == 42, "Array copy constructor variant must copy its entries into independent storage"); + Value wrapped{}; _ZN3sce4Json5ValueC2ERKNS0_5ArrayE(&wrapped, &array); + const auto* child = _ZNK3sce4Json5Array5frontEv(reinterpret_cast(wrapped.payload)); + Require(wrapped.type == 6 && child->parent == &wrapped && child->payload == 42, "Array-to-value constructor variant must bind copied children to their owner"); _ZN3sce4Json5ValueD2Ev(&wrapped); + Object object{}, copiedObject{}; _ZN3sce4Json6ObjectC2Ev(&object); + _ZN3sce4Json5Value3setEl(_ZN3sce4Json6ObjectixERKNS0_6StringE(&object, &text), 42); + _ZN3sce4Json6ObjectC2ERKS1_(&copiedObject, &object); + Require(object.storage != copiedObject.storage && _ZNK3sce4Json6Object4sizeEv(&copiedObject) == 1, "Object copy constructor variant must own independent tree storage"); + _ZN3sce4Json5ValueC2ERKNS0_6ObjectE(&wrapped, &object); + child = _ZNK3sce4Json5ValueixEPKc(&wrapped, "abc"); + Require(wrapped.type == 7 && child->parent == &wrapped && child->payload == 42, "Object-to-value constructor variant must bind copied members to their owner"); _ZN3sce4Json5ValueD2Ev(&wrapped); + Pair pair{}; _ZN3sce4Json6Object4PairC2Ev(&pair); + Require(pair.key.storage && pair.value.type == 0, "Default pair constructor variant must construct its key and null value"); _ZN3sce4Json6Object4PairD2Ev(&pair); + _ZN3sce4Json6Object4PairC2ERKNS0_6StringERKNS0_5ValueE(&pair, &text, &value); + Require(pair.key.storage != text.storage && pair.value.type == 2 && pair.value.payload == 42, "Pair constructor variant must copy its key and value"); _ZN3sce4Json6Object4PairD2Ev(&pair); + Iterator iterator{}, copy{}; + _ZN3sce4Json5Array8iteratorC2Ev(&iterator); _ZN3sce4Json5Array8iteratorC2ERKS2_(©, &iterator); + Require(iterator.state && copy.state && iterator.state != copy.state && !*static_cast(copy.state), "Default array iterator variants must own independent unbound states"); + _ZN3sce4Json5Array8iteratorD2Ev(©); _ZN3sce4Json5Array8iteratorD2Ev(&iterator); + _ZNK3sce4Json5Array5beginEv(&iterator, &array); _ZN3sce4Json5Array8iteratorC2ERKS2_(©, &iterator); + Require(copy.state != iterator.state && _ZNK3sce4Json5Array8iteratordeEv(©) == _ZNK3sce4Json5Array5frontEv(&array), "Array iterator copy variant must preserve the actual element identity"); + _ZN3sce4Json5Array8iteratorD2Ev(©); _ZN3sce4Json5Array8iteratorD2Ev(&iterator); + _ZN3sce4Json6Object8iteratorC2Ev(&iterator); _ZN3sce4Json6Object8iteratorC2ERKS2_(©, &iterator); + Require(iterator.state && copy.state && iterator.state != copy.state && !*static_cast(copy.state), "Default object iterator variants must own independent unbound states"); + _ZN3sce4Json6Object8iteratorD2Ev(©); _ZN3sce4Json6Object8iteratorD2Ev(&iterator); + _ZNK3sce4Json6Object5beginEv(&iterator, &object); _ZN3sce4Json6Object8iteratorC2ERKS2_(©, &iterator); + Require(copy.state != iterator.state && _ZNK3sce4Json6Object8iteratordeEv(©) == _ZNK3sce4Json6Object8iteratordeEv(&iterator), "Object iterator copy variant must preserve the actual member identity"); + _ZN3sce4Json6Object8iteratorD2Ev(©); _ZN3sce4Json6Object8iteratorD2Ev(&iterator); + _ZN3sce4Json6ObjectD2Ev(&copiedObject); _ZN3sce4Json6ObjectD2Ev(&object); + _ZN3sce4Json5ArrayD2Ev(&copiedArray); _ZN3sce4Json5ArrayD2Ev(&array); _ZN3sce4Json5ValueD2Ev(&value); + _ZN3sce4Json6StringD2Ev(&copiedText); _ZN3sce4Json6StringD2Ev(&text); _ZN3sce4Json6StringD2Ev(&empty); + Require(trace.live.size() == baseline, "All constructor/destructor variants must reclaim their owned resources"); + String absent{}; + const auto requests = trace.requests; + _ZN3sce4Json5ValueC2ERKNS0_6StringE(&value, &absent); + Require(value.type == 0 && trace.requests == requests, "Missing string storage must leave a null value without allocating"); _ZN3sce4Json5ValueD2Ev(&value); + _ZN3sce4Json5ValueC2EPKc(&value, nullptr); CheckText(value, ""); _ZN3sce4Json5ValueD2Ev(&value); + struct Failure { bool once; int budget; int type; unsigned notifications; std::size_t requests; const char* text; }; + const Failure failures[]{ + {false, 0, 0, 1, 1, ""}, {false, 1, 0, 2, 3, ""}, + {false, 2, 0, 1, 3, ""}, {false, 3, 0, 1, 4, ""}, + {false, 4, 5, 1, 5, ""}, {false, 5, 5, 0, 5, "abc"}, + {true, 0, 0, 1, 1, ""}, {true, 1, 5, 1, 4, ""}, + {true, 2, 0, 1, 3, ""}, {true, 3, 0, 1, 4, ""}, + {true, 4, 5, 1, 5, ""}, {true, 5, 5, 0, 5, "abc"}, + }; + for (const auto& failure : failures) { + const auto notifications = trace.notifications; + const auto before = trace.requests; + trace.budget = failure.budget; trace.once = failure.once; + _ZN3sce4Json5ValueC2EPKc(&value, "abc"); trace.budget = -1; trace.once = false; + Require(value.type == failure.type && trace.notifications - notifications == failure.notifications && trace.requests - before == failure.requests, "Text constructor variant must preserve temporary string allocation and failure admission"); + if (value.type == 5) CheckText(value, failure.text); + _ZN3sce4Json5ValueD2Ev(&value); + Require(trace.live.size() == baseline, "Failed constructor variants must reclaim their admitted prefix"); + } + _ZN3sce4Json11InitializerD2Ev(initializer.data()); + Require(initializer[0] == 0 && trace.live.empty(), "Initializer destructor variant must terminate its resources"); + for (std::size_t i = 1; i < initializer.size(); ++i) Require(initializer[i] == 0xa5, "Initializer destruction must preserve every adjacent byte"); + return 0; +} diff --git a/docs/dev/debt/libSceJson2.md b/docs/dev/debt/libSceJson2.md index fd51f78b21..8e5de886ce 100644 --- a/docs/dev/debt/libSceJson2.md +++ b/docs/dev/debt/libSceJson2.md @@ -53,11 +53,8 @@ ### Unknown 3.20 import declarations - [_ZN3sce4Json11Initializer24setAllocatorInfoCallBackEPFviNS0_9ValueTypeEPvES3_](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `R996H0YIhiQ` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only. -- [_ZN3sce4Json11InitializerC2Ev](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `6qFqND4iwPA` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only. -- [_ZN3sce4Json11InitializerD2Ev](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `qQZGdYkEytk` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only. - [_ZN3sce4Json12MemAllocatorD0Ev](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `ypazoTrKYhE` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only. - [_ZN3sce4Json12MemAllocatorD1Ev](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `O1uwoqazS2A` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only. -- [_ZN3sce4Json17InitParameterRttiC2EPNS0_14AllocParamRttiEPvm](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `Mp8DPb3M4I0` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only. - [_ZN3sce4Json19InternalInitializer19terminate_staticlibEv](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `dvp2zGSQzMs` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only. - [_ZN3sce4Json19InternalInitializer20initialize_staticlibEPKNS0_13InitParameterENS1_10InitOptionE](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `BPSPc3pUMJo` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only. - [_ZN3sce4Json19InternalInitializerC1Ev](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `WntRKhYTmZw` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only. @@ -68,13 +65,7 @@ - [_ZN3sce4Json5Array10push_frontERKNS0_5ValueE](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `MQxDxBzWz40` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only. - [_ZN3sce4Json5Array5eraseERKNS1_8iteratorE](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `2mbVAtshWRI` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only. - [_ZN3sce4Json5Array6insertERKNS1_8iteratorERKNS0_5ValueE](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `ixJAz92H1uE` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only. -- [_ZN3sce4Json5Array8iteratorC2ERKS2_](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `Hdc3DSIsG2I` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only. -- [_ZN3sce4Json5Array8iteratorC2Ev](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `JSg1MSo7NKE` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only. -- [_ZN3sce4Json5Array8iteratorD2Ev](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `9niNrXsF3Bc` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only. - [_ZN3sce4Json5Array8pop_backEv](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `woec1toi4Xw` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only. -- [_ZN3sce4Json5ArrayC2ERKS1_](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `6NlbpyIfUuY` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only. -- [_ZN3sce4Json5ArrayC2Ev](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `t6AHhkWu4mY` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only. -- [_ZN3sce4Json5ArrayD2Ev](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `MIyMPw7YTGM` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only. - [_ZN3sce4Json5Value11referStringEv](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `m5J28iw-QPs` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only. - [_ZN3sce4Json5Value12referBooleanEv](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `QxjfcfBhEdc` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only. - [_ZN3sce4Json5Value12referIntegerEv](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `R0ac5QOdlpo` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only. @@ -82,32 +73,7 @@ - [_ZN3sce4Json5Value9referRealEv](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `t7UEJrhojhk` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only. - [_ZN3sce4Json5Value9serializeEPFiRNS0_6StringEPvES4_](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `PyMbL9F2oBY` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only. - [_ZN3sce4Json5Value9serializeERNS0_6StringEPFiS3_PvES4_](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `l1URiQJlSoU` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only. -- [_ZN3sce4Json5ValueC2ENS0_9ValueTypeE](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `PWm9MyJJVqU` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only. -- [_ZN3sce4Json5ValueC2EPKc](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `+hHa4QYtLY8` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only. -- [_ZN3sce4Json5ValueC2ERKNS0_5ArrayE](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `VH9dsKpQTmk` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only. -- [_ZN3sce4Json5ValueC2ERKNS0_6ObjectE](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `JXlrCLLCLmc` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only. -- [_ZN3sce4Json5ValueC2ERKNS0_6StringE](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `veNviXt6wC0` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only. -- [_ZN3sce4Json5ValueC2ERKS1_](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `TZyuFeGuw9Y` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only. -- [_ZN3sce4Json5ValueC2Eb](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `OK4Ot0ue7J0` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only. -- [_ZN3sce4Json5ValueC2Ed](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `23nm4oXHlfI` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only. -- [_ZN3sce4Json5ValueC2El](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `EjxUpzR2Yx8` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only. -- [_ZN3sce4Json5ValueC2Em](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `cqucBPSeVDA` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only. -- [_ZN3sce4Json5ValueC2Ev](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `-wa17B7TGnw` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only. -- [_ZN3sce4Json5ValueD2Ev](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `0eUrW9JAxM0` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only. - [_ZN3sce4Json6MallocEm](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `Xzy0onDzSAc` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only. -- [_ZN3sce4Json6Object4PairC2ERKNS0_6StringERKNS0_5ValueE](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `lt3J4dPvEtM` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only. -- [_ZN3sce4Json6Object4PairC2Ev](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `Wu-urs6MMpQ` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only. -- [_ZN3sce4Json6Object4PairD2Ev](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `TM0Sj+Ebins` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only. -- [_ZN3sce4Json6Object8iteratorC2ERKS2_](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `r5CShmcua+M` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only. -- [_ZN3sce4Json6Object8iteratorC2Ev](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `OxO+V0ouoS4` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only. -- [_ZN3sce4Json6Object8iteratorD2Ev](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `patTzc7zBjw` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only. -- [_ZN3sce4Json6ObjectC2ERKS1_](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `tSRqQ-+Y4PE` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only. -- [_ZN3sce4Json6ObjectC2Ev](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `SkKczWHdklc` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only. -- [_ZN3sce4Json6ObjectD2Ev](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `1siRBursJjw` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only. -- [_ZN3sce4Json6StringC2EPKc](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `N78gkQzXRL4` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only. -- [_ZN3sce4Json6StringC2ERKS1_](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `gALFgNfF+9I` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only. -- [_ZN3sce4Json6StringC2Ev](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `eG9E9M6XvTM` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only. -- [_ZN3sce4Json6StringD2Ev](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `Ui7YFnSTCBw` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only. - [_ZNK3sce4Json14InitParameter211getUserDataEv](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `GWtzpTKbZ+0` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only. - [_ZNK3sce4Json14InitParameter212getAllocatorEv](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `BykPm1ajcM0` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only. - [_ZNK3sce4Json14InitParameter217getFileBufferSizeEv](../../../core/libs/prx/libSceJson2/InventoryExports.cpp) (libSceJson2) - NID `Pcg6xQUhq9E` from the PS5 3.20 export inventory; prototype and behavior are unverified. Declaration is for import resolution only.