mirror of
https://gitlab.com/rnger/amath
synced 2025-10-06 10:59:56 +00:00
64 bit optimizations
This commit is contained in:
@ -83,8 +83,13 @@ void* AllocMemSafe(size_t size)
|
||||
list->count = 0;
|
||||
}
|
||||
|
||||
#if defined(__x86_64__) || defined(__aarch64__)
|
||||
// Align to bytes of 8
|
||||
allocsize = (size + 7) & ~0x07;
|
||||
#else
|
||||
// Align to bytes of 4
|
||||
allocsize = (size + 3) & ~0x03;
|
||||
#endif
|
||||
|
||||
newblock = (struct MemoryBlock*)ALLOC_MEM(sizeof(struct MemoryBlock));
|
||||
if (!newblock) {
|
||||
|
@ -52,7 +52,11 @@
|
||||
* sizeof(word) MUST BE A POWER OF TWO
|
||||
* SO THAT wmask BELOW IS ALL ONES
|
||||
*/
|
||||
typedef int word; // "word" used for optimal copy speed
|
||||
#if defined(__x86_64__) || defined(__aarch64__)
|
||||
typedef uint64_t word;
|
||||
#else
|
||||
typedef uint32_t word;
|
||||
#endif
|
||||
|
||||
/**
|
||||
*
|
||||
|
Reference in New Issue
Block a user