GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
xalloc(l) BEGEMOT Library xalloc(l)

xalloc, xrealloc - memory allocation with simple error check

# include <begemot.h>
void * xalloc(size_t size);
void * xrealloc(void *ptr, size_t size);
void xfree(void *ptr);

These functions are a layer above the malloc(3C) and realloc(3C) functions. They call these basic functions and check whether the returned pointer is NULL. In this case panic(l) is called with the message 'Out of memory: param' , where param are the parameters to the allocation function.

See malloc(3C) and realloc(3C) for a description of the arguments.

These functions have the following additional features:

-
xalloc(0) returns a unique pointer for each call.
-
xfree(NULL) is legal.
-
xrealloc(NULL, 0) behaves like xalloc(0).
-
xrealloc(NULL, s) will behave like xalloc(s).
-
xrealloc(p, 0) behaves like a sequence of free(p) and xalloc(0).

See malloc(3C) and realloc(3C) for a description of the return values. Note that these functions never return NULL.

malloc(3C), realloc(3C), panic(l)
31 May 1996 BEGEMOT

Search for    or go to Top of page |  Section l |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.