#include "config.h"
#include <stdint.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <sys/resource.h>
#include <errno.h>
#include "system-alloc.h"
#include "internal_logging.h"
#include "base/logging.h"
#include "base/commandlineflags.h"
#include "base/spinlock.h"
構成 | |
union | MemoryAligner |
class | SbrkSysAllocator |
class | MmapSysAllocator |
class | DevMemSysAllocator |
マクロ定義 | |
#define | MAP_ANONYMOUS MAP_ANON |
関数 | |
DEFINE_int32 (malloc_devmem_start, 0,"Physical memory starting location in MB for /dev/mem allocation."" Setting this to 0 disables /dev/mem allocation") | |
DEFINE_int32 (malloc_devmem_limit, 0,"Physical memory limit location in MB for /dev/mem allocation."" Setting this to 0 means no limit.") | |
bool | RegisterSystemAllocator (SysAllocator *a, int priority) |
void | InitSystemAllocators (void) |
void * | TCMalloc_SystemAlloc (size_t size, size_t *actual_size, size_t alignment) |
void | TCMalloc_SystemRelease (void *start, size_t length) |
変数 | |
static SpinLock | spinlock (SpinLock::LINKER_INITIALIZED) |
static size_t | pagesize = 0 |
static char | sbrk_space [sizeof(SbrkSysAllocator)] |
static char | mmap_space [sizeof(MmapSysAllocator)] |
static char | devmem_space [sizeof(DevMemSysAllocator)] |
static const int | kStaticAllocators = 3 |
static const int | kMaxAllocators = 5 |
SysAllocator * | allocators [kMaxAllocators] |
static bool | system_alloc_inited = false |
#define MAP_ANONYMOUS MAP_ANON |
DEFINE_int32 | ( | malloc_devmem_limit | , | |
0 | , | |||
"Physical memory limit location in MB for /dev/mem allocation."" Setting this to 0 means no limit." | ||||
) |
DEFINE_int32 | ( | malloc_devmem_start | , | |
0 | , | |||
"Physical memory starting location in MB for /dev/mem allocation."" Setting this to 0 disables /dev/mem allocation" | ||||
) |
void InitSystemAllocators | ( | void | ) |
bool RegisterSystemAllocator | ( | SysAllocator * | a, | |
int | priority | |||
) |
void* TCMalloc_SystemAlloc | ( | size_t | size, | |
size_t * | actual_size, | |||
size_t | alignment | |||
) |
void TCMalloc_SystemRelease | ( | void * | start, | |
size_t | length | |||
) |
tcmalloc-0.93/system-alloc.cc の 389 行で定義されています。
参照元 TCMalloc_PageHeap::IncrementalScavenge(), と ReleaseFreeList().
tcmalloc-0.93/system-alloc.cc の 123 行で定義されています。
char devmem_space[sizeof(DevMemSysAllocator)] [static] |
const int kMaxAllocators = 5 [static] |
const int kStaticAllocators = 3 [static] |
tcmalloc-0.93/system-alloc.cc の 120 行で定義されています。
char mmap_space[sizeof(MmapSysAllocator)] [static] |
size_t pagesize = 0 [static] |
tcmalloc-0.93/system-alloc.cc の 79 行で定義されています。
char sbrk_space[sizeof(SbrkSysAllocator)] [static] |
bool system_alloc_inited = false [static] |