+
+ // Locate a free location in the address space (between brk and MM_USER_MAX)
+ // TODO: Prefer first location after DestHint, but can go below
+
+ // Search downwards from the top of user memory
+ mapping_base = 0;
+ for( tPage *dst = (tPage*)MM_USER_MAX - npages; dst > (tPage*)PAGE_SIZE; dst -- )
+ {
+ if( _range_free(dst, npages) ) {
+ mapping_base = (tVAddr)dst;
+ break;
+ }
+ }
+ if( mapping_base == 0 )