|
|
1.1 root 1: #include <stdio.h>
2: #include <ipxe/uaccess.h>
3: #include <ipxe/umalloc.h>
4: #include <ipxe/io.h>
5:
6: void umalloc_test ( void ) {
7: struct memory_map memmap;
8: userptr_t bob;
9: userptr_t fred;
10:
11: printf ( "Before allocation:\n" );
12: get_memmap ( &memmap );
13:
14: bob = umalloc ( 1234 );
15: bob = urealloc ( bob, 12345 );
16: fred = umalloc ( 999 );
17:
18: printf ( "After allocation:\n" );
19: get_memmap ( &memmap );
20:
21: ufree ( bob );
22: ufree ( fred );
23:
24: printf ( "After freeing:\n" );
25: get_memmap ( &memmap );
26: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.