mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-09-09 02:55:45 +00:00
haze: adjust banner, new lines between class sections, single-statement if
This commit is contained in:
parent
6a46d3a3e9
commit
a3f088a658
14 changed files with 43 additions and 42 deletions
Binary file not shown.
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 6.2 KiB |
|
@ -1,2 +1,2 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg id="svg1500" width="182" height="182" version="1.1" viewBox="0 0 182 182" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><defs id="defs1484"><linearGradient id="a" x1="36.532" x2="36.532" y1="39.898" y2="80.671" gradientTransform="scale(1.0484 .95387)" gradientUnits="userSpaceOnUse"><stop id="stop1474" stop-color="#fff" offset="0"/><stop id="stop1476" stop-color="#9FC1DB" offset="1"/></linearGradient><linearGradient id="b" x1="23.249" x2="11.852" y1="45.658" y2="96.793" gradientTransform="scale(1.4434 .69282)" gradientUnits="userSpaceOnUse"><stop id="stop1479" stop-color="#90B9D9" offset="0"/><stop id="stop1481" stop-color="#554BBA" offset="1"/></linearGradient><linearGradient id="linearGradient2139" x1="451.42" x2="426.88" y1="93.955" y2="145.12" gradientTransform="matrix(1.4611 0 0 1.4611 -557.72 -38.455)" gradientUnits="userSpaceOnUse" xlink:href="#b"/><linearGradient id="linearGradient2147" x1="436.58" x2="451.74" y1="96.001" y2="108.43" gradientTransform="matrix(1.4611 0 0 1.4611 -557.72 -34.137)" gradientUnits="userSpaceOnUse" xlink:href="#a"/><linearGradient id="linearGradient5197" x1="438.54" x2="455.23" y1="117.18" y2="124.38" gradientTransform="matrix(1.5947 0 0 1.5947 -617.05 -51.062)" gradientUnits="userSpaceOnUse" xlink:href="#a"/><linearGradient id="linearGradient5199" x1="36.532" x2="36.532" y1="39.898" y2="80.671" gradientTransform="scale(1.0484 .95387)" gradientUnits="userSpaceOnUse" xlink:href="#a"/><linearGradient id="linearGradient5201" x1="23.249" x2="11.852" y1="45.658" y2="96.793" gradientTransform="scale(1.4434 .69282)" gradientUnits="userSpaceOnUse" xlink:href="#b"/></defs><rect id="rect6884" width="182" height="182" ry="0" fill="#37394c" stop-color="#000000"/><rect id="rect1998" x="80.151" y="98.821" width="21.697" height="14.613" fill="url(#linearGradient2147)" stop-color="#000000"/><g id="g1496" transform="matrix(1.4611 0 0 1.4611 32.1 18.644)" fill-rule="evenodd" stroke-width=".68442"><path id="path1492" d="m66.043 63.522c-4.4024-7.6092-14.404-17.621-25.731-24.185-10.448-6.0551-21.562-6.537-29.778-7.3067l22.406-28.406c3.1989-4.0555 9.0925-4.7599 13.164-1.5735 0.58763 0.45991 1.1179 0.98817 1.5797 1.5735l31.603 40.065c1.3355 1.6931 1.3355 4.0764 0 5.7695l-9.6889 12.283c-0.88287 1.1172-2.1972 1.7421-3.5551 1.7797z" fill="url(#linearGradient5199)"/><path id="path1494" d="m55.327 59.799c-4.7798-1.3155-9.815-2.0184-15.015-2.0184-6.0585 0-11.893 0.95408-17.361 2.7196-2.4521 0.79178-4.8304 1.7467-7.1221 2.8521-1.7676 0.44364-3.6705-0.17473-4.8293-1.6438l-9.6621-12.249c-1.3355-1.6931-1.3355-4.0764 0-5.7695l9.5093-12.056c0.13415-8.21e-4 0.2684-0.0012 0.40276-0.0012 23.698 0 44.398 12.786 55.527 31.811-0.60115 0.11208-1.2256 0.10755-1.8375-0.02238-3.0587-1.486-6.2728-2.7038-9.6115-3.6227z" fill="url(#linearGradient5201)"/></g><path id="rect1828" d="m107.41 151.77v-41.952c0-1.4858-1.1967-2.6824-2.6825-2.6824h-27.447c-1.4858 0-2.6825 1.1967-2.6825 2.6824v41.952c0 13.67 13.523 9.3797 13.523 23.423v10.594h5.7652v-10.594c0-14.043 13.523-9.7531 13.523-23.423" fill="url(#linearGradient2139)" stop-color="#000000"/><path id="path1334" d="m91 116.2-2.5153 4.3556h1.7943v22.263l-4.5798-4.3348c-0.2957-0.3689-0.50311-0.85159-0.51463-1.3481 0-2.0086-5.2e-4 -3.2015-8.82e-4 -3.6405 0.84792-0.29761 1.46-1.0971 1.46-2.0475 0-1.2023-0.97564-2.178-2.1784-2.178-1.2033 0-2.1786 0.97563-2.1786 2.178 0 0.9504 0.61169 1.7499 1.4589 2.0475l-6.01e-4 3.5979c0 0.97511 0.53498 1.9969 1.1622 2.6472-0.01854-0.0177-0.0384-0.0363 3.53e-4 8.9e-4 0.01589 0.0143 4.8585 4.5991 4.8585 4.5991 0.29527 0.36811 0.50139 0.85054 0.51324 1.3467v2.5185c-1.6637 0.33382-2.9172 1.803-2.9172 3.5654 0 2.0093 1.6288 3.6381 3.6375 3.6381 2.0093 0 3.6382-1.6288 3.6382-3.6381 0-1.7627-1.2545-3.2319-2.9197-3.5657v-2.4743c0-6e-3 3.53e-4 -0.0121 0-0.0191v-5.4728c0.01209-0.49523 0.21903-0.97704 0.51464-1.3448 0 0 4.8427-4.5843 4.8583-4.5985 0.03901-0.0367 0.01854-0.0184 3.54e-4 -3.5e-4 0.62708-0.65035 1.1617-1.6726 1.1617-2.6478l-7.86e-4 -3.4673h1.4604v-4.3568h-4.3563v4.3568h1.4585s-8.83e-4 0.91324-8.83e-4 3.5098c-0.01095 0.49662-0.21857 0.9798-0.51427 1.3486l-4.5807 4.3358v-16.818h1.7972z" fill="url(#linearGradient5197)"/></svg>
|
||||
<svg id="svg1500" width="182" height="182" version="1.1" viewBox="0 0 182 182" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><defs id="defs1484"><linearGradient id="a" x1="36.532" x2="36.532" y1="39.898" y2="80.671" gradientTransform="scale(1.0484 .95387)" gradientUnits="userSpaceOnUse"><stop id="stop1474" stop-color="#fff" offset="0"/><stop id="stop1476" stop-color="#9FC1DB" offset="1"/></linearGradient><linearGradient id="linearGradient2139" x1="451.42" x2="426.88" y1="93.955" y2="145.12" gradientTransform="matrix(1.4611 0 0 1.4611 -557.72 -38.455)" gradientUnits="userSpaceOnUse"><stop id="stop1479" stop-color="#90B9D9" offset="0"/><stop id="stop1481" stop-color="#554BBA" offset="1"/></linearGradient><linearGradient id="linearGradient2147" x1="436.58" x2="451.74" y1="96.001" y2="108.43" gradientTransform="matrix(1.4611 0 0 1.4611 -557.72 -34.137)" gradientUnits="userSpaceOnUse" xlink:href="#a"/><linearGradient id="linearGradient5197" x1="438.54" x2="455.23" y1="117.18" y2="124.38" gradientTransform="matrix(1.5947 0 0 1.5947 -617.05 -51.062)" gradientUnits="userSpaceOnUse" xlink:href="#a"/></defs><rect id="rect6884" width="182" height="182" ry="0" fill="#37394c" stop-color="#000000"/><g id="g1716" transform="matrix(1.8352 0 0 1.8352 -75.998 -148.92)" stroke-width=".54491"><rect id="rect1998" x="80.151" y="91.556" width="21.697" height="21.879" ry="1.4596" fill="url(#linearGradient2147)" stop-color="#000000"/><path id="rect1828" d="m107.41 151.77v-41.952c0-1.4858-1.1967-2.6824-2.6825-2.6824h-27.447c-1.4858 0-2.6825 1.1967-2.6825 2.6824v41.952c0 13.67 13.523 9.3797 13.523 23.423v10.594h5.7652v-10.594c0-14.043 13.523-9.7531 13.523-23.423" fill="url(#linearGradient2139)" stop-color="#000000"/><path id="path1334" d="m91 116.2-2.5153 4.3556h1.7943v22.263l-4.5798-4.3348c-0.2957-0.3689-0.50311-0.85159-0.51463-1.3481 0-2.0086-5.2e-4 -3.2015-8.82e-4 -3.6405 0.84792-0.29761 1.46-1.0971 1.46-2.0475 0-1.2023-0.97564-2.178-2.1784-2.178-1.2033 0-2.1786 0.97563-2.1786 2.178 0 0.9504 0.61169 1.7499 1.4589 2.0475l-6.01e-4 3.5979c0 0.97511 0.53498 1.9969 1.1622 2.6472-0.01854-0.0177-0.0384-0.0363 3.53e-4 8.9e-4 0.01589 0.0143 4.8585 4.5991 4.8585 4.5991 0.29527 0.36811 0.50139 0.85054 0.51324 1.3467v2.5185c-1.6637 0.33382-2.9172 1.803-2.9172 3.5654 0 2.0093 1.6288 3.6381 3.6375 3.6381 2.0093 0 3.6382-1.6288 3.6382-3.6381 0-1.7627-1.2545-3.2319-2.9197-3.5657v-2.4743c0-6e-3 3.53e-4 -0.0121 0-0.0191v-5.4728c0.01209-0.49523 0.21903-0.97704 0.51464-1.3448 0 0 4.8427-4.5843 4.8583-4.5985 0.03901-0.0367 0.01854-0.0184 3.54e-4 -3.5e-4 0.62708-0.65035 1.1617-1.6726 1.1617-2.6478l-7.86e-4 -3.4673h1.4604v-4.3568h-4.3563v4.3568h1.4585s-8.83e-4 0.91324-8.83e-4 3.5098c-0.01095 0.49662-0.21857 0.9798-0.51427 1.3486l-4.5807 4.3358v-16.818h1.7972z" fill="url(#linearGradient5197)" stroke-width=".54491"/></g></svg>
|
||||
|
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 2.9 KiB |
|
@ -23,16 +23,13 @@ namespace haze {
|
|||
class AsyncUsbServer final {
|
||||
private:
|
||||
EventReactor *m_reactor;
|
||||
|
||||
public:
|
||||
constexpr explicit AsyncUsbServer() : m_reactor() { /* ... */ }
|
||||
|
||||
Result Initialize(const UsbCommsInterfaceInfo *interface_info, u16 id_vendor, u16 id_product, EventReactor *reactor);
|
||||
void Finalize();
|
||||
|
||||
private:
|
||||
Result TransferPacketImpl(bool read, void *page, u32 size, u32 *out_size_transferred) const;
|
||||
|
||||
public:
|
||||
Result ReadPacket(void *page, u32 size, u32 *out_size_transferred) const {
|
||||
return this->TransferPacketImpl(true, page, size, out_size_transferred);
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace haze {
|
|||
class ConsoleMainLoop : public EventConsumer {
|
||||
private:
|
||||
static constexpr size_t FrameDelayNs = 33333333;
|
||||
|
||||
private:
|
||||
EventReactor *m_reactor;
|
||||
PtpObjectHeap *m_object_heap;
|
||||
|
||||
|
@ -36,7 +36,6 @@ namespace haze {
|
|||
u32 m_last_heap_used;
|
||||
u32 m_last_heap_total;
|
||||
bool m_is_applet_mode;
|
||||
|
||||
private:
|
||||
static void Run(void *arg) {
|
||||
static_cast<ConsoleMainLoop *>(arg)->Run();
|
||||
|
@ -49,11 +48,14 @@ namespace haze {
|
|||
Waiter cancel_waiter = waiterForUEvent(std::addressof(m_cancel_event));
|
||||
Result rc = waitObjects(std::addressof(idx), std::addressof(cancel_waiter), 1, FrameDelayNs);
|
||||
|
||||
if (R_SUCCEEDED(rc)) break;
|
||||
if (svc::ResultTimedOut::Includes(rc)) ueventSignal(std::addressof(m_event));
|
||||
if (R_SUCCEEDED(rc)) {
|
||||
break;
|
||||
}
|
||||
if (svc::ResultTimedOut::Includes(rc)) {
|
||||
ueventSignal(std::addressof(m_event));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
explicit ConsoleMainLoop() : m_reactor(), m_pad(), m_thread(), m_event(), m_cancel_event(), m_last_heap_used(), m_last_heap_total(), m_is_applet_mode() { /* ... */ }
|
||||
|
||||
|
@ -110,12 +112,12 @@ namespace haze {
|
|||
m_last_heap_total = heap_total;
|
||||
|
||||
const char *used_unit = "B";
|
||||
if (heap_used > 1024) { heap_used >>= 10; used_unit = "KiB"; }
|
||||
if (heap_used > 1024) { heap_used >>= 10; used_unit = "MiB"; }
|
||||
if (heap_used >= 1024) { heap_used >>= 10; used_unit = "KiB"; }
|
||||
if (heap_used >= 1024) { heap_used >>= 10; used_unit = "MiB"; }
|
||||
|
||||
const char *total_unit = "B";
|
||||
if (heap_total > 1024) { heap_total >>= 10; total_unit = "KiB"; }
|
||||
if (heap_total > 1024) { heap_total >>= 10; total_unit = "MiB"; }
|
||||
if (heap_total >= 1024) { heap_total >>= 10; total_unit = "KiB"; }
|
||||
if (heap_total >= 1024) { heap_total >>= 10; total_unit = "MiB"; }
|
||||
|
||||
consoleClear();
|
||||
printf("USB File Transfer\n\n");
|
||||
|
|
|
@ -29,7 +29,6 @@ namespace haze {
|
|||
private:
|
||||
EventConsumer *m_consumers[MAX_WAIT_OBJECTS];
|
||||
Waiter m_waiters[MAX_WAIT_OBJECTS];
|
||||
|
||||
s32 m_num_wait_objects;
|
||||
bool m_stop_requested;
|
||||
|
||||
|
|
|
@ -24,7 +24,6 @@ namespace haze {
|
|||
private:
|
||||
EventReactor *m_reactor;
|
||||
FsFileSystem *m_filesystem;
|
||||
|
||||
public:
|
||||
constexpr explicit FilesystemProxy() : m_reactor(), m_filesystem() { /* ... */ }
|
||||
|
||||
|
@ -39,7 +38,6 @@ namespace haze {
|
|||
m_reactor = nullptr;
|
||||
m_filesystem = nullptr;
|
||||
}
|
||||
|
||||
private:
|
||||
template <typename F, typename... Args>
|
||||
Result ForwardResult(F func, Args &&... args) {
|
||||
|
@ -49,7 +47,6 @@ namespace haze {
|
|||
|
||||
R_RETURN(rc);
|
||||
}
|
||||
|
||||
public:
|
||||
Result GetTotalSpace(const char *path, s64 *out) {
|
||||
R_RETURN(this->ForwardResult(fsFsGetTotalSpace, m_filesystem, path, out));
|
||||
|
|
|
@ -28,7 +28,6 @@ namespace haze {
|
|||
size_t m_offset;
|
||||
u8 *m_data;
|
||||
bool m_disabled;
|
||||
|
||||
private:
|
||||
template <typename T>
|
||||
constexpr static size_t Strlen(const T *str) {
|
||||
|
@ -50,7 +49,6 @@ namespace haze {
|
|||
R_RETURN(m_server->WritePacket(m_data, m_offset));
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
constexpr explicit PtpDataBuilder(void *data, AsyncUsbServer *server) : m_server(server), m_transmitted_size(), m_offset(), m_data(static_cast<u8 *>(data)), m_disabled() { /* ... */ }
|
||||
|
||||
|
|
|
@ -28,7 +28,6 @@ namespace haze {
|
|||
u32 m_offset;
|
||||
u8 *m_data;
|
||||
bool m_eos;
|
||||
|
||||
private:
|
||||
Result Flush() {
|
||||
R_UNLESS(!m_eos, haze::ResultEndOfTransmission());
|
||||
|
@ -40,7 +39,6 @@ namespace haze {
|
|||
|
||||
R_RETURN(m_server->ReadPacket(m_data, haze::UsbBulkPacketBufferSize, std::addressof(m_received_size)));
|
||||
}
|
||||
|
||||
public:
|
||||
constexpr explicit PtpDataParser(void *data, AsyncUsbServer *server) : m_server(server), m_received_size(), m_offset(), m_data(static_cast<u8 *>(data)), m_eos() { /* ... */ }
|
||||
|
||||
|
|
|
@ -70,7 +70,6 @@ namespace haze {
|
|||
}
|
||||
};
|
||||
};
|
||||
|
||||
private:
|
||||
using ObjectNameToIdTreeTraits = util::IntrusiveRedBlackTreeMemberTraitsDeferredAssert<&ObjectNode::m_object_name_to_id_node>;
|
||||
using ObjectNameToIdTree = ObjectNameToIdTreeTraits::TreeType<ObjectNode::NameComparator>;
|
||||
|
@ -82,13 +81,11 @@ namespace haze {
|
|||
ObjectNameToIdTree m_name_to_object_id;
|
||||
ObjectIdToNameTree m_object_id_to_name;
|
||||
u32 m_next_object_id;
|
||||
|
||||
public:
|
||||
constexpr explicit PtpObjectDatabase() : m_object_heap(), m_name_to_object_id(), m_object_id_to_name(), m_next_object_id() { /* ... */ }
|
||||
|
||||
void Initialize(PtpObjectHeap *object_heap);
|
||||
void Finalize();
|
||||
|
||||
public:
|
||||
/* Object database API. */
|
||||
Result AddObjectId(const char *parent_name, const char *name, u32 *out_object_id, u32 parent_id, u32 desired_object_id = 0);
|
||||
|
|
|
@ -24,18 +24,16 @@ namespace haze {
|
|||
class PtpObjectHeap {
|
||||
private:
|
||||
static constexpr size_t NumHeapBlocks = 2;
|
||||
|
||||
private:
|
||||
void *m_heap_blocks[NumHeapBlocks];
|
||||
void *m_next_address;
|
||||
u32 m_heap_block_size;
|
||||
u32 m_current_heap_block;
|
||||
|
||||
public:
|
||||
constexpr explicit PtpObjectHeap() : m_heap_blocks(), m_next_address(), m_heap_block_size(), m_current_heap_block() { /* ... */ }
|
||||
|
||||
void Initialize();
|
||||
void Finalize();
|
||||
|
||||
public:
|
||||
constexpr size_t GetSizeTotal() const {
|
||||
return m_heap_block_size * NumHeapBlocks;
|
||||
|
@ -44,7 +42,6 @@ namespace haze {
|
|||
constexpr size_t GetSizeUsed() const {
|
||||
return (m_heap_block_size * m_current_heap_block) + this->GetNextAddress() - this->GetFirstAddress();
|
||||
}
|
||||
|
||||
private:
|
||||
constexpr u8 *GetNextAddress() const { return static_cast<u8 *>(m_next_address); }
|
||||
constexpr u8 *GetFirstAddress() const { return static_cast<u8 *>(m_heap_blocks[m_current_heap_block]); }
|
||||
|
@ -58,8 +55,12 @@ namespace haze {
|
|||
}
|
||||
|
||||
constexpr bool AllocationIsSatisfyable(size_t n) const {
|
||||
if (this->GetNextAddress() + n < this->GetNextAddress()) return false;
|
||||
if (this->GetNextAddress() + n > this->GetCurrentBlockEnd()) return false;
|
||||
if (this->GetNextAddress() + n < this->GetNextAddress()) {
|
||||
return false;
|
||||
}
|
||||
if (this->GetNextAddress() + n > this->GetCurrentBlockEnd()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -80,17 +81,20 @@ namespace haze {
|
|||
|
||||
return result;
|
||||
}
|
||||
|
||||
public:
|
||||
template <typename T = void>
|
||||
constexpr T *Allocate(size_t n) {
|
||||
if (n + 7 < n) return nullptr;
|
||||
if (n + 7 < n) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/* Round up the amount to a multiple of 8. */
|
||||
n = (n + 7) & ~7ull;
|
||||
|
||||
/* Check if the allocation is possible. */
|
||||
if (!this->AllocationIsPossible(n)) return nullptr;
|
||||
if (!this->AllocationIsPossible(n)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/* If the allocation is not satisfyable now, we might be able to satisfy it on the next block. */
|
||||
/* However, if the next block would be empty, we won't be able to satisfy the request. */
|
||||
|
|
|
@ -32,7 +32,6 @@ namespace haze {
|
|||
PtpObjectHeap *m_object_heap;
|
||||
u32 m_send_object_id;
|
||||
bool m_session_open;
|
||||
|
||||
PtpObjectDatabase m_object_database;
|
||||
|
||||
public:
|
||||
|
|
|
@ -30,11 +30,9 @@ namespace haze {
|
|||
private:
|
||||
UsbDsInterface *m_interface;
|
||||
UsbDsEndpoint *m_endpoints[UsbSessionEndpoint_Count];
|
||||
|
||||
private:
|
||||
Result Initialize1x(const UsbCommsInterfaceInfo *info);
|
||||
Result Initialize5x(const UsbCommsInterfaceInfo *info);
|
||||
|
||||
public:
|
||||
constexpr explicit UsbSession() : m_interface(), m_endpoints() { /* ... */ }
|
||||
|
||||
|
|
|
@ -60,7 +60,9 @@ namespace haze {
|
|||
/* Check if an object with this name already exists. If it does, we can just return it here. */
|
||||
auto it = m_name_to_object_id.find_key(node->m_name);
|
||||
if (it != m_name_to_object_id.end()) {
|
||||
if (out_object_id) *out_object_id = it->GetObjectId();
|
||||
if (out_object_id) {
|
||||
*out_object_id = it->GetObjectId();
|
||||
}
|
||||
R_SUCCEED();
|
||||
}
|
||||
|
||||
|
@ -74,7 +76,9 @@ namespace haze {
|
|||
m_object_id_to_name.insert(*node);
|
||||
|
||||
/* Set output. */
|
||||
if (out_object_id) *out_object_id = node->GetObjectId();
|
||||
if (out_object_id) {
|
||||
*out_object_id = node->GetObjectId();
|
||||
}
|
||||
|
||||
/* We succeeded. */
|
||||
R_SUCCEED();
|
||||
|
@ -83,7 +87,9 @@ namespace haze {
|
|||
void PtpObjectDatabase::RemoveObjectId(u32 object_id) {
|
||||
/* Find in forward mapping. */
|
||||
auto it = m_object_id_to_name.find_key(object_id);
|
||||
if (it == m_object_id_to_name.end()) return;
|
||||
if (it == m_object_id_to_name.end()) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Free the node. */
|
||||
ObjectNode *node = std::addressof(*it);
|
||||
|
@ -95,7 +101,9 @@ namespace haze {
|
|||
PtpObjectDatabase::ObjectNode *PtpObjectDatabase::GetObject(u32 object_id) {
|
||||
/* Find in forward mapping. */
|
||||
auto it = m_object_id_to_name.find_key(object_id);
|
||||
if (it == m_object_id_to_name.end()) return nullptr;
|
||||
if (it == m_object_id_to_name.end()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return std::addressof(*it);
|
||||
}
|
||||
|
|
|
@ -28,7 +28,9 @@ namespace haze {
|
|||
size_t mem_used = 0;
|
||||
|
||||
/* Skip re-initialization if we are currently initialized. */
|
||||
if (m_heap_block_size != 0) return;
|
||||
if (m_heap_block_size != 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Estimate how much memory we can reserve. */
|
||||
HAZE_R_ABORT_UNLESS(svcGetInfo(std::addressof(mem_used), InfoType_UsedMemorySize, CUR_PROCESS_HANDLE, 0));
|
||||
|
@ -50,7 +52,9 @@ namespace haze {
|
|||
}
|
||||
|
||||
void PtpObjectHeap::Finalize() {
|
||||
if (m_heap_block_size == 0) return;
|
||||
if (m_heap_block_size == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Tear down the heap, allowing a subsequent call to Initialize() if desired. */
|
||||
for (size_t i = 0; i < NumHeapBlocks; i++) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue