64 bit optimizations

This commit is contained in:
Carsten Larsen
2017-01-21 20:51:25 +01:00
parent afbfd236a4
commit 40cc850093
2 changed files with 10 additions and 1 deletions
+5
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) {
+5 -1
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
/**
*