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

Method push_frag_offset

src/proxy/hdrs/HTTP.cc:2437–2456  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2435}
2436
2437void
2438HTTPInfo::push_frag_offset(FragOffset offset)
2439{
2440 ink_assert(m_alt);
2441 if (nullptr == m_alt->m_frag_offsets) {
2442 m_alt->m_frag_offsets = m_alt->m_integral_frag_offsets;
2443 } else if (m_alt->m_frag_offset_count >= HTTPCacheAlt::N_INTEGRAL_FRAG_OFFSETS &&
2444 0 == (m_alt->m_frag_offset_count & (m_alt->m_frag_offset_count - 1))) {
2445 // need more space than in integral storage and we're at an upgrade
2446 // size (power of 2).
2447 FragOffset *nf = static_cast<FragOffset *>(ats_malloc(sizeof(FragOffset) * (m_alt->m_frag_offset_count * 2)));
2448 memcpy(nf, m_alt->m_frag_offsets, sizeof(FragOffset) * m_alt->m_frag_offset_count);
2449 if (m_alt->m_frag_offsets != m_alt->m_integral_frag_offsets) {
2450 ats_free(m_alt->m_frag_offsets);
2451 }
2452 m_alt->m_frag_offsets = nf;
2453 }
2454
2455 m_alt->m_frag_offsets[m_alt->m_frag_offset_count++] = offset;
2456}

Callers 2

openWriteWriteDoneMethod · 0.80

Calls 3

ats_mallocFunction · 0.85
ats_freeFunction · 0.85
memcpyFunction · 0.50

Tested by

no test coverage detected