Skip to content

Commit 872b8c7

Browse files
committed
Documenting that free/reallocate must take nullptrs
See godotengine/godot#112363
1 parent 4f82dd0 commit 872b8c7

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Jolt/Core/Memory.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,19 @@ JPH_NAMESPACE_BEGIN
88

99
#ifndef JPH_DISABLE_CUSTOM_ALLOCATOR
1010

11-
// Normal memory allocation, must be at least 8 byte aligned on 32 bit platform and 16 byte aligned on 64 bit platform
11+
/// Normal memory allocation, must be at least 8 byte aligned on 32 bit platform and 16 byte aligned on 64 bit platform.
1212
using AllocateFunction = void *(*)(size_t inSize);
13+
14+
/// Reallocate memory. inBlock can be nullptr in which case it must behave as a memory allocation.
1315
using ReallocateFunction = void *(*)(void *inBlock, size_t inOldSize, size_t inNewSize);
16+
17+
/// Free memory. inBlock can be nullptr in which case it must do nothing.
1418
using FreeFunction = void (*)(void *inBlock);
1519

16-
// Aligned memory allocation
20+
/// Aligned memory allocation.
1721
using AlignedAllocateFunction = void *(*)(size_t inSize, size_t inAlignment);
22+
23+
/// Free aligned memory. inBlock can be nullptr in which case it must do nothing.
1824
using AlignedFreeFunction = void (*)(void *inBlock);
1925

2026
// User defined allocation / free functions

0 commit comments

Comments
 (0)