malloc.h 661 字节
Newer Older
M
maweiye 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
#ifndef _MALLOC_H
#define _MALLOC_H

#ifdef __cplusplus
extern "C" {
#endif

#define __NEED_size_t

#include <bits/alltypes.h>

void *malloc (size_t);
void *calloc (size_t, size_t);
void *realloc (void *, size_t);
void free (void *);
void *valloc (size_t);
void *memalign(size_t, size_t);

size_t malloc_usable_size(void *);

21 22 23 24 25 26 27 28 29 30
#define __MALLINFO_BODY \
  size_t arena; \
  size_t ordblks; \
  size_t smblks; \
  size_t hblks; \
  size_t hblkhd; \
  size_t usmblks; \
  size_t fsmblks; \
  size_t uordblks; \
  size_t fordblks; \
M
maweiye 已提交
31
  size_t keepcost;
32 33 34 35

struct mallinfo { __MALLINFO_BODY };

struct mallinfo2 { __MALLINFO_BODY };
M
maweiye 已提交
36 37 38 39 40 41

#ifdef __cplusplus
}
#endif

#endif