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


Manual Reference Pages  -  XALLOC (l)

NAME

xalloc, xrealloc - memory allocation with simple error check

CONTENTS

Synopsis
Description

SYNOPSIS


# include <begemot.h>

void * xalloc(size_t size);

void * xrealloc(void *ptr, size_t size);

void xfree(void *ptr);

DESCRIPTION

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).

RETURN VALUE

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

SEE ALSO

malloc(3C), realloc(3C), panic(l)
Search for    or go to Top of page |  Section l |  Main Index


BEGEMOT XALLOC (l) 31 May 1996

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