@node xrealloc, memory @subheading Syntax @example #include void *xrealloc(void *ptr, size_t size); @end example @subheading Description This function is just like @code{realloc} (@pxref{realloc}), except that if there is no more memory, it prints an error message and exits. It can also properly handle @var{ptr} being @code{NULL}. Note that, currently, the header @file{stdlib.h} does @strong{not} declare a prototype for @code{xrealloc}, because many programs declare its prototype in different and conflicting ways. If you use @code{xrealloc} in your own code, you might need to provide your own prototype explicitly. @subheading Return Value A pointer to a possibly new block. @subheading Portability @portability !ansi, !posix @subheading Example @example char *buf; buf = (char *)xrealloc(buf, new_size); @end example