Moving around some math macros.

This commit is contained in:
Ben Vanik
2014-08-16 17:18:20 -07:00
parent 54ce9db743
commit 5b83cf5fd1
23 changed files with 148 additions and 137 deletions

View File

@@ -63,11 +63,11 @@ void* X64CodeCache::PlaceCode(void* machine_code, size_t code_size,
size_t alloc_size = code_size;
// Add unwind info into the allocation size. Keep things 16b aligned.
alloc_size += XEROUNDUP(X64CodeChunk::UNWIND_INFO_SIZE, 16);
alloc_size += poly::round_up(X64CodeChunk::UNWIND_INFO_SIZE, 16);
// Always move the code to land on 16b alignment. We do this by rounding up
// to 16b so that all offsets are aligned.
alloc_size = XEROUNDUP(alloc_size, 16);
alloc_size = poly::round_up(alloc_size, 16);
lock_.lock();
@@ -106,7 +106,8 @@ X64CodeChunk::X64CodeChunk(size_t chunk_size)
buffer = (uint8_t*)VirtualAlloc(NULL, capacity, MEM_RESERVE | MEM_COMMIT,
PAGE_EXECUTE_READWRITE);
fn_table_capacity = (uint32_t)XEROUNDUP(capacity / ESTIMATED_FN_SIZE, 16);
fn_table_capacity =
static_cast<uint32_t>(poly::round_up(capacity / ESTIMATED_FN_SIZE, 16));
size_t table_size = fn_table_capacity * sizeof(RUNTIME_FUNCTION);
fn_table = (RUNTIME_FUNCTION*)xe_malloc(table_size);
fn_table_count = 0;