forked from cfadmin-cn/cfadmin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcore_memory.h
More file actions
37 lines (30 loc) · 773 Bytes
/
core_memory.h
File metadata and controls
37 lines (30 loc) · 773 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef __CORE_MEMORY__
#define __CORE_MEMORY__
#if defined(JEMALLOC)
#include <jemalloc/jemalloc.h>
#elif defined(TCMALLOC)
#include <gperftools/tcmalloc.h>
#ifndef EXIT_SUCCESS
#define EXIT_SUCCESS (0)
#endif
#ifndef EXIT_FAILURE
#define EXIT_FAILURE (1)
#endif
#define malloc tc_malloc
#define calloc tc_calloc
#define realloc tc_realloc
#define free tc_free
void exit(int status);
void _exit(int status);
int atoi(const char *nptr);
char * getenv(const char* name);
int unsetenv(const char* name);
int setenv(const char* name, const char* value, int overwrite);
#else
#include <stdlib.h>
#endif
void* xmalloc (size_t size);
void* xcalloc (size_t nmemb, size_t size);
void* xrealloc(void* ptr, size_t size);
void xfree(void *ptr);
#endif