From: Ben Pfaff Date: Sun, 30 Jan 2005 07:49:18 +0000 (+0000) Subject: Rename xmalloc() as malloc_or_panic(), X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f2b3a9b0e72eb25010d1fa757687fd8a87658ef;p=pintos-anon Rename xmalloc() as malloc_or_panic(), xcalloc() as calloc_or_panic(). --- diff --git a/src/threads/malloc.c b/src/threads/malloc.c index 9c83e3d..4f8675c 100644 --- a/src/threads/malloc.c +++ b/src/threads/malloc.c @@ -158,7 +158,7 @@ malloc (size_t size) kernel to panic in normal operation, so this function should only be used during kernel initialization. */ void * -xmalloc (size_t size) +malloc_or_panic (size_t size) { void *p = malloc (size); if (p == NULL && size > 0) @@ -192,7 +192,7 @@ calloc (size_t a, size_t b) kernel to panic in normal operation, so this function should only be used during kernel initialization. */ void * -xcalloc (size_t a, size_t b) +calloc_or_panic (size_t a, size_t b) { void *p = calloc (a, b); if (p == NULL && a > 0 && b > 0) diff --git a/src/threads/malloc.h b/src/threads/malloc.h index 4f0d0bf..a07a7b0 100644 --- a/src/threads/malloc.h +++ b/src/threads/malloc.h @@ -6,9 +6,9 @@ void malloc_init (void); void *malloc (size_t) __attribute__ ((malloc)); -void *xmalloc (size_t) __attribute__ ((malloc)); +void *malloc_or_panic (size_t) __attribute__ ((malloc)); void *calloc (size_t, size_t) __attribute__ ((malloc)); -void *xcalloc (size_t, size_t) __attribute__ ((malloc)); +void *calloc_or_panic (size_t, size_t) __attribute__ ((malloc)); void free (void *); #endif /* threads/malloc.h */