op_growable_buffer.c File Reference

a growable buffer implementation More...

#include "op_growable_buffer.h"
#include "op_libiberty.h"
#include <string.h>
#include <stdlib.h>
Include dependency graph for op_growable_buffer.c:

Functions

void init_buffer (struct growable_buffer *b)
 init_buffer - initialize an empty buffer
void free_buffer (struct growable_buffer *b)
 free_buffer - free the memory allocated for this buffer
void add_data (struct growable_buffer *b, void const *data, size_t len)
 add_data - add data to this buffer

Detailed Description

a growable buffer implementation

Remarks:
Copyright 2007 OProfile authors
Read the file COPYING
Author:
Philippe Elie

Function Documentation

void add_data ( struct growable_buffer b,
void const *  data,
size_t  len 
)

add_data - add data to this buffer

Parameters:
b the buffer where to add data
data a pointer to the data to add
len number of byte to add to the buffer

References growable_buffer::max_size, growable_buffer::p, and growable_buffer::size.

void free_buffer ( struct growable_buffer buffer  ) 

free_buffer - free the memory allocated for this buffer

Parameters:
buffer the buffer to free

References growable_buffer::p.

Referenced by finalize_debug_line_info().

void init_buffer ( struct growable_buffer buffer  ) 

init_buffer - initialize an empty buffer

Parameters:
buffer the buffer to initialize

init_buffer do not do any allocation, the first allocation will occur when add_data() with a non zero len param will be called.

References growable_buffer::max_size, growable_buffer::p, and growable_buffer::size.

Referenced by init_debug_line_info().


Generated on 29 Jul 2013 for oprofile by  doxygen 1.6.1