summaryrefslogtreecommitdiffstats
path: root/contrib/syslinux-4.02/gpxe/src/tests/umalloc_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/syslinux-4.02/gpxe/src/tests/umalloc_test.c')
-rw-r--r--contrib/syslinux-4.02/gpxe/src/tests/umalloc_test.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/contrib/syslinux-4.02/gpxe/src/tests/umalloc_test.c b/contrib/syslinux-4.02/gpxe/src/tests/umalloc_test.c
new file mode 100644
index 0000000..7a36186
--- /dev/null
+++ b/contrib/syslinux-4.02/gpxe/src/tests/umalloc_test.c
@@ -0,0 +1,26 @@
+#include <stdio.h>
+#include <gpxe/uaccess.h>
+#include <gpxe/umalloc.h>
+#include <gpxe/memmap.h>
+
+void umalloc_test ( void ) {
+ struct memory_map memmap;
+ userptr_t bob;
+ userptr_t fred;
+
+ printf ( "Before allocation:\n" );
+ get_memmap ( &memmap );
+
+ bob = umalloc ( 1234 );
+ bob = urealloc ( bob, 12345 );
+ fred = umalloc ( 999 );
+
+ printf ( "After allocation:\n" );
+ get_memmap ( &memmap );
+
+ ufree ( bob );
+ ufree ( fred );
+
+ printf ( "After freeing:\n" );
+ get_memmap ( &memmap );
+}