You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

umalloc_test.c 482B

1234567891011121314151617181920212223242526
  1. #include <stdio.h>
  2. #include <ipxe/uaccess.h>
  3. #include <ipxe/umalloc.h>
  4. #include <ipxe/io.h>
  5. void umalloc_test ( void ) {
  6. struct memory_map memmap;
  7. userptr_t bob;
  8. userptr_t fred;
  9. printf ( "Before allocation:\n" );
  10. get_memmap ( &memmap );
  11. bob = umalloc ( 1234 );
  12. bob = urealloc ( bob, 12345 );
  13. fred = umalloc ( 999 );
  14. printf ( "After allocation:\n" );
  15. get_memmap ( &memmap );
  16. ufree ( bob );
  17. ufree ( fred );
  18. printf ( "After freeing:\n" );
  19. get_memmap ( &memmap );
  20. }