2002-03-08 23:20:52 +00:00
|
|
|
//===-- memory.c - String functions for the LLVM libc Library ----*- C -*-===//
|
|
|
|
//
|
|
|
|
// A lot of this code is ripped gratuitously from glibc and libiberty.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
2003-12-15 22:32:50 +00:00
|
|
|
void *malloc(size_t) __attribute__((weak));
|
|
|
|
void free(void *) __attribute__((weak));
|
|
|
|
void *memset(void *, int, size_t) __attribute__((weak));
|
|
|
|
void *calloc(size_t nelem, size_t elsize) __attribute__((weak));
|
2002-03-08 23:20:52 +00:00
|
|
|
|
|
|
|
void *calloc(size_t nelem, size_t elsize) {
|
|
|
|
void *Result = malloc(nelem*elsize);
|
|
|
|
return memset(Result, 0, nelem*elsize);
|
|
|
|
}
|