Browse Source

Merge pull request #1706 from oon3m0oo/develop

Fix #1705 where we incorrectly calculate page locations.
tags/v0.3.3
Martin Kroeker GitHub 7 years ago
parent
commit
8ef7d4fb54
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      driver/others/memory.c

+ 3
- 2
driver/others/memory.c View File

@@ -637,7 +637,7 @@ static inline BLASULONG run_bench(BLASULONG address, BLASULONG size) {

static void *alloc_mmap(void *address){
void *map_address, *best_address;
BLASULONG best, start, current;
BLASULONG best, start, current, original;
BLASULONG allocsize;

if (address){
@@ -685,8 +685,9 @@ static void *alloc_mmap(void *address){

start = (BLASULONG)map_address;
current = (SCALING - 1) * allocation_block_size;
original = current;

while(current > 0) {
while(current > 0 && current <= original) {
*(BLASLONG *)start = (BLASLONG)start + PAGESIZE;
start += PAGESIZE;
current -= PAGESIZE;


Loading…
Cancel
Save