medfall

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit a3209ba9783f625e6325e6f6080d00b28082482f
parent 0f5597d645a1eac1231e24aa46f2cf2890033729
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Sat Aug 20 20:55:17 +0100

Give align_TODO a real name

Diffstat:
intrinsics.h | 4+---
memory_arena.cc | 2+-
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/intrinsics.h b/intrinsics.h @@ -32,9 +32,7 @@ typedef double f64; #define align4( n ) align_power_of_2( n, 4 ) #define align8( n ) align_power_of_2( n, 8 ) #define align16( n ) align_power_of_2( n, 16 ) - -// TODO: clashes with some crap in std::string -#define align_TODO( n, alignment ) ( ( ( n ) + ( alignment ) - 1 ) / ( alignment ) * ( alignment ) ) +#define align_arbitrary( n, alignment ) ( ( ( n ) + ( alignment ) - 1 ) / ( alignment ) * ( alignment ) ) #define kilobytes( kb ) ( size_t( kb ) * size_t( 1024 ) ) #define megabytes( mb ) ( kilobytes( mb ) * size_t( 1024 ) ) diff --git a/memory_arena.cc b/memory_arena.cc @@ -9,7 +9,7 @@ void memarena_init( MemoryArena * const arena, u8 * const memory, const size_t s u8 * memarena_push_size( MemoryArena * const arena, const size_t size, const uptr alignment ) { uptr mem_addr = ( uptr ) arena->memory; - uptr aligned_addr = align_TODO( mem_addr + arena->used, alignment ); + uptr aligned_addr = align_arbitrary( mem_addr + arena->used, alignment ); uptr new_used = size + ( aligned_addr - mem_addr ); assert( new_used <= arena->size ); assert( new_used >= arena->used );