home *** CD-ROM | disk | FTP | other *** search
- #include "compiler.h"
-
-
- /* (c) 1985, Phoenix Computer Products Corp. and Novum Organum, Inc. */
- /***
- * name : memgive - allocate space from heap.
- * memgivetrap - allocate, but don't longjmp on out of space
- * memtake - free memory allocated with memgive() and givecopy()
- *
- * synopsis: p = memgive(siz)
- * p = memgivetrap(siz)
- * siz size of cell being allocated.
- * memtake(p)
- * p pointer to allocated memory space.
- *
- * description: these calls may seem redundant, but it makes the library
- * functions more implementation independent. for example,
- * my libraries run on a system call PORT, which is a multi-object
- * message passing distributed system. there are special functions
- * which must be called when getting and freeing. however, they
- * are not called malloc() and free(), but _alloc() and _free().
- * in addition, there are other functions named malloc() and
- * free(), so I can't dummy up free, i.e. free(p){_free(p);}.
- * however, since all my functions call memgive() and memtake()
- * I just dummy them up, i.e. memtake(p){_free(p);}, in this
- * file and everything transports over with no problem.
- *
- * returns:
- *
- * (C) novum organum, inc. 1985
- *
- ***/
- #include "cptpdf.h"
-
- char *memgive (siz)
- int siz;
- {
- char *space;
-
- if (!(space = CALLOC (1, siz))) /* if not allocated do a leave */
- sylongjmp(SE_OUTOFHEAP);
-
- return (space);
- }
-
- char *memgivetrap (siz)
- int siz;
- {
- char *space;
-
- space = CALLOC (1, siz);
-
- return (space);
- }
-
- memtake (allocd_mem)
- char *allocd_mem;
- {
- FREE (allocd_mem);
- }
-