home *** CD-ROM | disk | FTP | other *** search
- /*
- oakalloc.c
-
- % 'oakland' insulated alloc functions
-
- OWL 1.1
- Copyright (c) 1986, 1987, 1988 by Oakland Group, Inc.
- ALL RIGHTS RESERVED.
-
- Revision History:
- -----------------
- */
-
- #include "oakhead.h"
-
- /* -------------------------------------------------------------------------- */
-
- VOID *omalloc(tag, size)
- int tag;
- SIZE_T size;
- /*
- Call malloc with the given size.
- Return the result.
- If malloc fails, sets oak_errno to tag
- */
- {
- VOID *m;
-
- if ((m = (VOID *)malloc(size)) == NULL) {
- oak_SetErrno(tag);
- }
-
- return(m);
- }
- /* -------------------------------------------------------------------------- */
-
- VOID *ocalloc(tag, n, size)
- int tag;
- SIZE_T n;
- SIZE_T size;
- /*
- Call calloc with the given size.
- Return the result.
- If calloc fails, sets oak_errno to tag
- */
- {
- VOID *m;
-
- if ((m = (VOID *)calloc(n, size)) == NULL) {
- oak_SetErrno(tag);
- }
-
- return(m);
- }
- /* -------------------------------------------------------------------------- */
-
- VOID *orealloc(tag, buffer, size)
- int tag;
- VOID *buffer;
- SIZE_T size;
- /*
- Call realloc with the given size and buffer.
- Return the result.
- If realloc fails, sets oak_errno to tag
- */
- {
- VOID *m;
-
- if ((m = (VOID *)realloc(buffer, size)) == NULL) {
- oak_SetErrno(tag);
- }
-
- return(m);
- }
- /* -------------------------------------------------------------------------- */
-
- void ofree(tag, buffer)
- int tag;
- VOID *buffer;
- /*
- Call free with the given buffer.
- Return the result.
- */
- {
- free(buffer);
- /* tag not used in this version */ oak_notused(tag);
- }
- /* -------------------------------------------------------------------------- */
-
-