home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 January
/
usenetsourcesnewsgroupsinfomagicjanuary1994.iso
/
sources
/
misc
/
volume20
/
rc
/
part04
/
nalloc.h
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1991-05-22
|
323 b
|
12 lines
extern Block *newblock(void);
extern void *nalloc(SIZE_T);
extern void nfree(void);
extern void restoreblock(Block *);
#undef offsetof
#define offsetof(t, m) ((SIZE_T) &((t *)0)->m)
/* memory allocation abbreviation */
#define nnew(x) ((x *) nalloc(sizeof(x)))
#define ncpy(x) (strcpy((char *) nalloc(strlen(x) + 1), x))