malloc.h 996 字节
Newer Older
M
maweiye 已提交
1 2 3 4 5 6 7 8 9 10 11
#ifndef _MALLOC_H
#define _MALLOC_H

#ifdef __cplusplus
extern "C" {
#endif

#define __NEED_size_t

#include <bits/alltypes.h>

R
r00490903 已提交
12 13 14 15 16 17 18 19 20 21
#define M_SET_THREAD_CACHE -1001
#define M_THREAD_CACHE_ENABLE 1
#define M_THREAD_CACHE_DISABLE 0

#define M_FLUSH_THREAD_CACHE -1002

#define M_DELAYED_FREE -1003
#define M_DELAYED_FREE_ENABLE 1
#define M_DELAYED_FREE_DISABLE 0

M
maweiye 已提交
22 23 24 25 26 27 28 29
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 *);
R
r00490903 已提交
30
int mallopt(int param, int value);
M
maweiye 已提交
31

32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
struct mallinfo {
  int arena;
  int ordblks;
  int smblks;
  int hblks;
  int hblkhd;
  int usmblks;
  int fsmblks;
  int uordblks;
  int fordblks;
  int keepcost;
};

struct mallinfo2 {
  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 已提交
55
  size_t keepcost;
56
};
M
maweiye 已提交
57 58 59 60 61 62

#ifdef __cplusplus
}
#endif

#endif