1 /*%% (c) Copyright 1993, 1994 Hewlett-Packard Company */
2 /*%% (c) Copyright 1993, 1994 International Business Machines Corp. */
3 /*%% (c) Copyright 1993, 1994 Sun Microsystems, Inc. */
4 /*%% (c) Copyright 1993, 1994 Novell, Inc. */
5 /*%% $XConsortium: isalloc.c /main/3 1995/10/23 11:33:43 rswiston $ */
7 static char sccsid[] = "@(#)isalloc.c 1.3 89/07/17 Copyr 1988 Sun Micro";
10 * Copyright (c) 1988 by Sun Microsystems, Inc.
17 * Functions that allocate and deallocate memory.
18 * All errors are treated as fatal.
21 #include "isam_impl.h"
24 /* strdup is not defined in Ultrix' string.h, so it is implemented in a separate
25 * file named strdup.ultrix.c
28 extern char *strdup();
37 char *_ismalloc(nbytes)
42 if ((p = (char *) malloc (nbytes)) == NULL)
43 _isfatal_error("malloc() failed");
48 char *_isrealloc(oldaddr, nbytes)
54 if ((p = (char *) realloc (oldaddr, nbytes)) == NULL)
55 _isfatal_error("realloc() failed");
64 * Create a duplicate of string in dynamic memory.
73 if ((p = strdup(str)) == NULL)
74 _isfatal_error("strdup() failed");
82 * Free dynamically allocated string.