Data Structures | Public Member Functions | Data Fields | Friends

HdrHeap Class Reference

#include <HdrHeap.h>

Collaboration diagram for HdrHeap:
Collaboration graph
[legend]

Data Structures

struct  HeapGuard
 Struct to prevent garbage collection on heaps. More...

Public Member Functions

void init ()
inkcoreapi void destroy ()
HdrHeapObjImplallocate_obj (int nbytes, int type)
void deallocate_obj (HdrHeapObjImpl *obj)
char * allocate_str (int nbytes)
char * expand_str (const char *old_str, int old_len, int new_len)
char * duplicate_str (const char *str, int nbytes)
void free_string (const char *s, int len)
inkcoreapi int marshal_length ()
inkcoreapi int marshal (char *buf, int length)
int unmarshal (int buf_length, int obj_type, HdrHeapObjImpl **found_obj, RefCountObj *block_ref)
int unmarshal_size () const
 Computes the valid data size of an unmarshalled instance.
void inherit_string_heaps (const HdrHeap *inherit_from)
int attach_block (IOBufferBlock *b, const char *use_start)
void set_ronly_str_heap_end (int slot, const char *end)
void lock_ronly_str_heap (int i)
void unlock_ronly_str_heap (int i)
void sanity_check_strs ()
bool check_marshalled (uint32_t buf_length)
void dump_heap (int len=-1)
int demote_rw_str_heap ()
void coalesce_str_heaps (int incoming_size=0)
void evacuate_from_str_heaps (HdrStrHeap *new_heap)
size_t required_space_for_evacuation ()
int attach_str_heap (char *h_start, int h_len, RefCountObj *h_ref_obj, int *index)

Data Fields

uint32_t m_magic
char * m_free_start
char * m_data_start
uint32_t m_size
bool m_writeable
HdrHeapm_next
uint32_t m_free_size
Ptr< HdrStrHeapm_read_write_heap
StrHeapDesc m_ronly_heap [HDR_BUF_RONLY_HEAPS]
int m_lost_string_space

Friends

class CoreUtils

Detailed Description

Definition at line 180 of file HdrHeap.h.


Member Function Documentation

HdrHeapObjImpl * HdrHeap::allocate_obj ( int  nbytes,
int  type 
)
char * HdrHeap::allocate_str ( int  nbytes  ) 
int HdrHeap::attach_block ( IOBufferBlock b,
const char *  use_start 
)
int HdrHeap::attach_str_heap ( char *  h_start,
int  h_len,
RefCountObj h_ref_obj,
int *  index 
) [inline]
bool HdrHeap::check_marshalled ( uint32_t  buf_length  ) 
void HdrHeap::coalesce_str_heaps ( int  incoming_size = 0  ) 
void HdrHeap::deallocate_obj ( HdrHeapObjImpl obj  ) 

Definition at line 235 of file HdrHeap.cc.

References ink_assert, HdrHeapObjImpl::m_type, and m_writeable.

Referenced by _mime_field_block_destroy(), and http_hdr_url_set().

int HdrHeap::demote_rw_str_heap (  ) 
void HdrHeap::destroy (  ) 
void HdrHeap::dump_heap ( int  len = -1  ) 

Definition at line 1096 of file HdrHeap.cc.

References content, HeapCheck::end, m_size, and memcpy.

Referenced by unmarshal().

char * HdrHeap::duplicate_str ( const char *  str,
int  nbytes 
)

Definition at line 317 of file HdrHeap.cc.

References allocate_str(), and memcpy.

Referenced by mime_field_value_set(), mime_parser_parse(), and mime_str_u16_set().

void HdrHeap::evacuate_from_str_heaps ( HdrStrHeap new_heap  ) 
char * HdrHeap::expand_str ( const char *  old_str,
int  old_len,
int  new_len 
)

Definition at line 303 of file HdrHeap.cc.

References m_read_write_heap.

Referenced by mime_field_value_append().

void HdrHeap::free_string ( const char *  s,
int  len 
) [inline]

Definition at line 307 of file HdrHeap.h.

References m_lost_string_space.

Referenced by mime_field_value_set(), mime_hdr_field_delete(), and mime_str_u16_set().

void HdrHeap::inherit_string_heaps ( const HdrHeap inherit_from  ) 
void HdrHeap::init ( void   )  [inline]
void HdrHeap::lock_ronly_str_heap ( int  i  )  [inline]

Definition at line 213 of file HdrHeap.h.

References StrHeapDesc::m_locked, and m_ronly_heap.

Referenced by HTTPHdr::parse_req(), and HTTPHdr::parse_resp().

int HdrHeap::marshal ( char *  buf,
int  length 
)
int HdrHeap::marshal_length (  ) 
size_t HdrHeap::required_space_for_evacuation (  ) 
void HdrHeap::sanity_check_strs (  ) 
void HdrHeap::set_ronly_str_heap_end ( int  slot,
const char *  end 
)

Definition at line 141 of file HdrTSOnly.cc.

References ink_assert, StrHeapDesc::m_heap_len, and m_ronly_heap.

Referenced by HTTPHdr::parse_req(), and HTTPHdr::parse_resp().

void HdrHeap::unlock_ronly_str_heap ( int  i  )  [inline]
int HdrHeap::unmarshal ( int  buf_length,
int  obj_type,
HdrHeapObjImpl **  found_obj,
RefCountObj block_ref 
)
int HdrHeap::unmarshal_size (  )  const [inline]

Computes the valid data size of an unmarshalled instance.

Callers should round up to HDR_PTR_SIZE to get the actual footprint.

Definition at line 315 of file HdrHeap.h.

References StrHeapDesc::m_heap_len, m_ronly_heap, and m_size.

Referenced by cache_bc::HTTPInfo_v21::copy_and_upgrade_unmarshalled_to_v23(), cache_bc::HTTPInfo_v21::marshalled_length(), and unmarshal().


Friends And Related Function Documentation

friend class CoreUtils [friend]

Definition at line 182 of file HdrHeap.h.


Field Documentation

uint32_t HdrHeap::m_magic
StrHeapDesc HdrHeap::m_ronly_heap[HDR_BUF_RONLY_HEAPS]
uint32_t HdrHeap::m_size

The documentation for this class was generated from the following files: