We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents b03ae3f + 6400868 commit 8ef7d4fCopy full SHA for 8ef7d4f
driver/others/memory.c
@@ -637,7 +637,7 @@ static inline BLASULONG run_bench(BLASULONG address, BLASULONG size) {
637
638
static void *alloc_mmap(void *address){
639
void *map_address, *best_address;
640
- BLASULONG best, start, current;
+ BLASULONG best, start, current, original;
641
BLASULONG allocsize;
642
643
if (address){
@@ -685,8 +685,9 @@ static void *alloc_mmap(void *address){
685
686
start = (BLASULONG)map_address;
687
current = (SCALING - 1) * allocation_block_size;
688
+ original = current;
689
- while(current > 0) {
690
+ while(current > 0 && current <= original) {
691
*(BLASLONG *)start = (BLASLONG)start + PAGESIZE;
692
start += PAGESIZE;
693
current -= PAGESIZE;
0 commit comments