blob: 560c6dae1da7c4d2af54a6ca7456a2257a3b6ae6 [file] [log] [blame]
Chris Lattner06eccf02002-03-08 23:20:52 +00001//===-- memory.c - String functions for the LLVM libc Library ----*- C -*-===//
2//
3// A lot of this code is ripped gratuitously from glibc and libiberty.
4//
5//===----------------------------------------------------------------------===//
6
7#include <stdlib.h>
8
Chris Lattner4f6a0982002-07-18 00:15:29 +00009void *malloc(size_t);
Chris Lattner06eccf02002-03-08 23:20:52 +000010void free(void *);
Chris Lattner4f6a0982002-07-18 00:15:29 +000011void *memset(void *, int, size_t);
Chris Lattner06eccf02002-03-08 23:20:52 +000012
13void *calloc(size_t nelem, size_t elsize) {
14 void *Result = malloc(nelem*elsize);
15 return memset(Result, 0, nelem*elsize);
16}