From dc6cdf37f7f40865cac42433b141491094f57797 Mon Sep 17 00:00:00 2001 From: doyle Date: Thu, 17 Feb 2022 00:38:06 +1100 Subject: [PATCH] dqn_align: Remove unused functions --- dqn.h | 39 --------------------------------------- 1 file changed, 39 deletions(-) diff --git a/dqn.h b/dqn.h index 30cc325..3cc20de 100644 --- a/dqn.h +++ b/dqn.h @@ -798,16 +798,6 @@ DQN_API void Dqn_LogVDefault(Dqn_LogType type, void *user_data, char const *file DQN_API void Dqn_LogV (Dqn_LogType type, void *user_data, char const *file, Dqn_uint file_len, char const *func, Dqn_uint func_len, Dqn_uint line, char const *fmt, va_list va); DQN_API void Dqn_Log (Dqn_LogType type, void *user_data, char const *file, Dqn_uint file_len, char const *func, Dqn_uint func_len, Dqn_uint line, char const *fmt, ...); -// ------------------------------------------------------------------------------------------------- -// NOTE: Dqn_Align -// ------------------------------------------------------------------------------------------------- -// 'AlignAddressEnsuringSpace" aligns even if pointer is aligned, align it again, ensuring there's -// at minimum 1 byte and at most 'alignment' bytes of space between the aligned pointer and raw -// pointer. We do this to keep metadata exactly 1 byte behind the aligned pointer. -// 'AlignAddress' is the same as above except it's a no-op if the address is already aligned. -DQN_API Dqn_uintptr Dqn_AlignAddressEnsuringSpace(Dqn_uintptr address, Dqn_u8 alignment); -DQN_API Dqn_uintptr Dqn_AlignAddress (Dqn_uintptr address, Dqn_u8 alignment); - // ------------------------------------------------------------------------------------------------- // NOTE: Dqn_AllocationTracer // ------------------------------------------------------------------------------------------------- @@ -3565,35 +3555,6 @@ DQN_API void Dqn_Log(Dqn_LogType type, void *user_data, char const *file, Dqn_ui va_end(va); } -// ------------------------------------------------------------------------------------------------- -// NOTE: Dqn_Align* -// ------------------------------------------------------------------------------------------------- -DQN_API Dqn_uintptr Dqn_AlignAddressEnsuringSpace(Dqn_uintptr address, Dqn_u8 alignment) -{ - Dqn_uintptr remainder = address % alignment; - Dqn_uintptr offset_to_align = alignment - remainder; - Dqn_uintptr result = address + offset_to_align; - DQN_ASSERT(result % alignment == 0); - DQN_ASSERT(result >= address); - DQN_ASSERT(offset_to_align >= 1 && offset_to_align <= alignment); - return result; -} - -DQN_API Dqn_uintptr Dqn_AlignAddress(Dqn_uintptr address, Dqn_u8 alignment) -{ - Dqn_uintptr result = address; - if (alignment > 0) - { - Dqn_uintptr remainder = result % alignment; - if (remainder > 0) - { - Dqn_uintptr offset_to_align = alignment - remainder; - result += offset_to_align; - } - } - return result; -} - // ------------------------------------------------------------------------------------------------- // NOTE: Dqn_AllocationTracer // -------------------------------------------------------------------------------------------------