home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 7
/
Aminet 7 - August 1995.iso
/
Aminet
/
text
/
hyper
/
ADtoHT2_1.lha
/
Source.lha
/
MyLib.lha
/
stdlib
/
calloc.c
< 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
|
1994-12-12
|
351 b
|
19 lines
#include <stdio.h>
#include <stdlib.h>
void *calloc(unsigned long nmemb,unsigned long size)
{
unsigned long l;
unsigned long *a;
void *b;
l=(nmemb*size+(sizeof(unsigned long)-1))&~(sizeof(unsigned long)-1);
a=(unsigned long *)(b=malloc(l));
if(b!=NULL)
{
do
*a++=0;
while((l-=sizeof(unsigned long))!=0);
}
return b;
}