kern

changeset 31:3ed041d07ae1

ops ... range->size = pgcount * PGSIZE not pg * PGSIZE
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 27 May 2011 13:08:23 +0300
parents bdd9bf70269d
children 2cb5ab18e76e 373a9f50b4e6
files src/klibc/malloc.c src/main.c
diffstat 2 files changed, 19 insertions(+), 1 deletions(-) [+]
line diff
     1.1 --- a/src/klibc/malloc.c	Fri May 27 12:05:38 2011 +0300
     1.2 +++ b/src/klibc/malloc.c	Fri May 27 13:08:23 2011 +0300
     1.3 @@ -90,7 +90,7 @@
     1.4  
     1.5  		range = alloc_node();
     1.6  		range->start = PAGE_TO_ADDR(pg);
     1.7 -		range->size = pg * PGSIZE;
     1.8 +		range->size = pgcount * PGSIZE;
     1.9  		add_range(range);
    1.10  		goto find_range;
    1.11  	}
     2.1 --- a/src/main.c	Fri May 27 12:05:38 2011 +0300
     2.2 +++ b/src/main.c	Fri May 27 13:08:23 2011 +0300
     2.3 @@ -69,6 +69,24 @@
     2.4  	dbg_print_vm(MEM_USER);
     2.5  	dbg_print_vm(MEM_KERNEL);
     2.6  
     2.7 +	{
     2.8 +		void *foo, *bar, *xyzzy, *koko, *lala;
     2.9 +
    2.10 +		foo = malloc(128);
    2.11 +		bar = malloc(32 * 1024);
    2.12 +		xyzzy = malloc(8000);
    2.13 +
    2.14 +		free(bar);
    2.15 +
    2.16 +		koko = malloc(700);
    2.17 +		lala = malloc(6 * 1024 * 1024);
    2.18 +
    2.19 +		free(xyzzy);
    2.20 +		free(foo);
    2.21 +		free(koko);
    2.22 +		free(lala);
    2.23 +	}
    2.24 +
    2.25  	for(;;) {
    2.26  		char c, keypress;
    2.27  		do {