summaryrefslogtreecommitdiff
path: root/runtime/GCCLibraries/libc/memory.c
blob: 560c6dae1da7c4d2af54a6ca7456a2257a3b6ae6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//===-- 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>

void *malloc(size_t);
void free(void *);
void *memset(void *, int, size_t);

void *calloc(size_t nelem, size_t elsize) {
  void *Result = malloc(nelem*elsize);
  return memset(Result, 0, nelem*elsize);
}