Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/godot_cpp/core/memory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class DefaultTypedAllocator {
_ALWAYS_INLINE_ void delete_allocation(T *p_allocation) { memdelete(p_allocation); }
};

#define memnew_arr(m_class, m_count) memnew_arr_template<m_class>(m_count)
#define memnew_arr(m_class, m_count) ::godot::memnew_arr_template<m_class>(m_count)

_FORCE_INLINE_ uint64_t *_get_element_count_ptr(uint8_t *p_ptr) {
return (uint64_t *)(p_ptr - Memory::DATA_OFFSET + Memory::ELEMENT_OFFSET);
Expand Down
12 changes: 6 additions & 6 deletions include/godot_cpp/templates/safe_refcount.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ namespace godot {
// even with threads that are already running.

// These are used in very specific areas of the engine where it's critical that these guarantees are held
#define SAFE_NUMERIC_TYPE_PUN_GUARANTEES(m_type) \
static_assert(sizeof(SafeNumeric<m_type>) == sizeof(m_type)); \
static_assert(alignof(SafeNumeric<m_type>) == alignof(m_type)); \
#define SAFE_NUMERIC_TYPE_PUN_GUARANTEES(m_type) \
static_assert(sizeof(::godot::SafeNumeric<m_type>) == sizeof(m_type)); \
static_assert(alignof(::godot::SafeNumeric<m_type>) == alignof(m_type)); \
static_assert(std::is_trivially_destructible_v<std::atomic<m_type>>);
#define SAFE_FLAG_TYPE_PUN_GUARANTEES \
static_assert(sizeof(SafeFlag) == sizeof(bool)); \
static_assert(alignof(SafeFlag) == alignof(bool));
#define SAFE_FLAG_TYPE_PUN_GUARANTEES \
static_assert(sizeof(::godot::SafeFlag) == sizeof(bool)); \
static_assert(alignof(::godot::SafeFlag) == alignof(bool));

template <typename T>
class SafeNumeric {
Expand Down
Loading