op_growable_buffer.c File Reference

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

Go to the source code of this file.

Functions

void init_buffer (struct growable_buffer *b)
void free_buffer (struct growable_buffer *b)
static void grow_buffer (struct growable_buffer *b)
void add_data (struct growable_buffer *b, void const *data, size_t len)

Detailed Description

a growable buffer implementation

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

Definition in file op_growable_buffer.c.


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

Definition at line 39 of file op_growable_buffer.c.

References grow_buffer(), growable_buffer::max_size, growable_buffer::p, and growable_buffer::size.

Referenced by add_compilation_unit(), add_debug_line(), emit_extended_opcode(), emit_lne_define_filename(), emit_opcode(), emit_opcode_signed(), emit_opcode_unsigned(), emit_signed_LEB128(), emit_string(), emit_unsigned_LEB128(), and emit_uword().

Here is the call graph for this function:

Here is the caller graph for this function:

void free_buffer ( struct growable_buffer buffer  ) 

free_buffer - free the memory allocated for this buffer

Parameters:
buffer the buffer to free

Definition at line 25 of file op_growable_buffer.c.

References growable_buffer::p.

Referenced by finalize_debug_line_info().

Here is the caller graph for this function:

static void grow_buffer ( struct growable_buffer b  )  [static]

Definition at line 31 of file op_growable_buffer.c.

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

Referenced by add_data().

Here is the caller graph for this function:

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.

Definition at line 17 of file op_growable_buffer.c.

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

Referenced by init_debug_line_info().

Here is the caller graph for this function:


Generated on 8 Nov 2012 for Oprofile by  doxygen 1.6.1