1
0
mirror of https://gitlab.com/rnger/amath synced 2025-10-06 10:59:56 +00:00

64 bit optimizations

This commit is contained in:
Carsten Larsen
2017-01-21 20:51:25 +01:00
parent 527f458967
commit 87c5e5e9b1
2 changed files with 10 additions and 1 deletions

View File

@ -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) {

View File

@ -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
/**
*