region_remove(&vmp->vm_regions_avl, r->vaddr);
USE(r,
- r->vaddr += len;
- r->length -= len;);
+ r->vaddr += len;);
remslots = phys_slot(r->length);
* point to the same addresses, make them shrink by the
* same amount.
*/
- for(voffset = offset; voffset < r->length;
+ for(voffset = len; voffset < r->length;
voffset += VM_PAGE_SIZE) {
if(!(pr = physblock_get(r, voffset))) continue;
assert(pr->offset >= offset);
+ assert(pr->offset >= len);
USE(pr, pr->offset -= len;);
}
if(remslots)
memmove(r->physblocks, r->physblocks + freeslots,
remslots * sizeof(struct phys_region *));
+ USE(r, r->length -= len;);
} else if(offset + len == r->length) {
assert(len <= r->length);
r->length -= len;
void testend(void) { }
+void basic_regression(void)
+{
+ void *block;
+#define BLOCKSIZE (PAGE_SIZE*10)
+ block = minix_mmap(0, BLOCKSIZE, PROT_READ | PROT_WRITE,
+ MAP_PRIVATE | MAP_ANON, -1, 0);
+
+ if(block == MAP_FAILED) { e(1); exit(1); }
+
+ memset(block, 0, BLOCKSIZE);
+
+ /* shrink from bottom */
+ minix_munmap(block, PAGE_SIZE);
+}
+
int
main(int argc, char *argv[])
{
start(74);
+ basic_regression();
+
makefiles(MAXFILES);
cachequiet(!bigflag);