MCPcopy Create free account
hub / github.com/apache/trafficserver / blk_alloc

Function blk_alloc

src/tscore/Arena.cc:39–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37 -------------------------------------------------------------------------*/
38
39static inline ArenaBlock *
40blk_alloc(int size)
41{
42 ArenaBlock *blk;
43
44 if (size == DEFAULT_BLOCK_SIZE) {
45 blk = static_cast<ArenaBlock *>(defaultSizeArenaBlock.alloc_void());
46 } else {
47 blk = static_cast<ArenaBlock *>(ats_malloc(size + sizeof(ArenaBlock) - 8));
48 }
49
50 blk->next = nullptr;
51 blk->m_heap_end = blk->data + size;
52 blk->m_water_level = blk->data;
53
54 return blk;
55}
56
57/*-------------------------------------------------------------------------
58 -------------------------------------------------------------------------*/

Callers 1

allocMethod · 0.85

Calls 2

ats_mallocFunction · 0.85
alloc_voidMethod · 0.45

Tested by

no test coverage detected