Skip to content

Commit 369e159

Browse files
authored
1.6: Addendum to 806da37 (Use at most c++14)
1 parent 806da37 commit 369e159

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Client/multiplayer_sa/CMultiplayerSA_FixMallocAlign.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111

1212
#include "StdInc.h"
1313

14-
namespace mta::memory
14+
namespace mta
15+
{
16+
namespace memory
1517
{
1618
constexpr bool is_power_of_two(std::size_t value) noexcept
1719
{
@@ -22,7 +24,7 @@ namespace mta::memory
2224

2325
// Safe aligned memory allocation replacement for CMemoryMgr::MallocAlign
2426
// Must match original GTA:SA behavior exactly - stores original pointer at result-4
25-
[[nodiscard]] void* SafeMallocAlign(std::size_t size, std::size_t alignment) noexcept
27+
void* SafeMallocAlign(std::size_t size, std::size_t alignment) noexcept
2628
{
2729
// Validate alignment FIRST to prevent undefined behavior in calculations
2830
if (alignment == 0 || !is_power_of_two(alignment) || alignment > 8192)
@@ -116,7 +118,7 @@ namespace mta::memory
116118
}
117119

118120
// VirtualAlloc implementation for large allocations
119-
[[nodiscard]] void* SafeMallocAlignVirtual(std::size_t size, std::size_t alignment) noexcept
121+
void* SafeMallocAlignVirtual(std::size_t size, std::size_t alignment) noexcept
120122
{
121123
// Validate parameters first to prevent undefined behavior
122124
if (alignment == 0 || !is_power_of_two(alignment) || alignment > 8192)
@@ -282,7 +284,7 @@ namespace mta::memory
282284
// Ignore exceptions in free - standard behavior
283285
}
284286
}
285-
} // namespace mta::memory
287+
} // namespace mta
286288

287289
// Hook constants
288290
#define HOOKPOS_CMemoryMgr_MallocAlign 0x72F4C0

0 commit comments

Comments
 (0)