Skip to content

Commit 8ef7d4f

Browse files
authored
Merge pull request #1706 from oon3m0oo/develop
Fix #1705 where we incorrectly calculate page locations.
2 parents b03ae3f + 6400868 commit 8ef7d4f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

driver/others/memory.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ static inline BLASULONG run_bench(BLASULONG address, BLASULONG size) {
637637

638638
static void *alloc_mmap(void *address){
639639
void *map_address, *best_address;
640-
BLASULONG best, start, current;
640+
BLASULONG best, start, current, original;
641641
BLASULONG allocsize;
642642

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

686686
start = (BLASULONG)map_address;
687687
current = (SCALING - 1) * allocation_block_size;
688+
original = current;
688689

689-
while(current > 0) {
690+
while(current > 0 && current <= original) {
690691
*(BLASLONG *)start = (BLASLONG)start + PAGESIZE;
691692
start += PAGESIZE;
692693
current -= PAGESIZE;

0 commit comments

Comments
 (0)