home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AmigActive 13
/
AACD13.ISO
/
AACD
/
Resources
/
System
/
BoingBag1
/
Contributions
/
Workbench
/
RexxArpLib3p6
/
src
/
memory.c
< prev
next >
Wrap
C/C++ Source or Header
|
1998-06-21
|
1KB
|
43 lines
/** Memory.c
* replacement for the use of malloc, which is declared unsafe
* for use with ONEDATA model. This is used, for now, because that is all 5.1
* supported for the original SAS C version and no modifications for this
* purpose are proposed. All uses of malloc and free in the original library
* have been replaced either with this or its equivalent code.
*
* CURRENT VERSION:
*
* This version has been converted to SAS C 6.5 format. It has been modified
* for modern definition sequences for ANSI compilation. This no longer works
* with OS versions prior to 2.04.
*
* AUTHOR/DATE: Joanne Dow, jdow@bix.com, June 1998.
* ============
*
**/
#include <exec/types.h>
#include <exec/exec.h>
#include <stdlib.h>
#include <proto/exec.h>
#include <pragmas/exec_pragmas.h>
void myfree(void *);
void *mymalloc(size_t);
void *mymalloc ( size_t size )
{
ULONG *foo;
foo = (ULONG *) AllocMem( (ULONG) (size + 4), MEMF_CLEAR );
*foo++ = size + 4;
return( (void *) foo );
}
void myfree ( void *thingie )
{
ULONG *foo = thingie;
foo--;
FreeMem( foo, *foo );
}