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

Function init_buffer_allocators

src/iocore/eventsystem/IOBuffer.cc:53–75  ·  view source on GitHub ↗

Initialization

Source from the content-addressed store, hash-verified

51// Initialization
52//
53void
54init_buffer_allocators(int iobuffer_advice, int chunk_sizes[DEFAULT_BUFFER_SIZES], bool use_hugepages)
55{
56 for (int i = 0; i < DEFAULT_BUFFER_SIZES; i++) {
57 int64_t s = DEFAULT_BUFFER_BASE_SIZE * ((static_cast<int64_t>(1)) << i);
58 int64_t a = DEFAULT_BUFFER_ALIGNMENT;
59 int n = chunk_sizes[i];
60 if (n == 0) {
61 n = i <= default_large_iobuffer_size ? DEFAULT_BUFFER_NUMBER : DEFAULT_HUGE_BUFFER_NUMBER;
62 }
63 if (s < a) {
64 a = s;
65 }
66
67 auto name = new char[64];
68 if (use_hugepages) {
69 snprintf(name, 64, "ioBufAllocatorHP[%d]", i);
70 } else {
71 snprintf(name, 64, "ioBufAllocator[%d]", i);
72 }
73 ioBufAllocator[i].re_init(name, s, n, a, use_hugepages, iobuffer_advice);
74 }
75}
76
77void
78init_buffer_allocators(int iobuffer_advice)

Callers 5

testRunStartingMethod · 0.85
ink_event_system_initFunction · 0.85
testRunStartingMethod · 0.85
init_tsFunction · 0.85

Calls 1

re_initMethod · 0.45

Tested by 1

testRunStartingMethod · 0.68