util::scoped_memory Class Reference

#include <mmap.hh>

List of all members.

Public Types

enum  Alloc { MMAP_ALLOCATED, ARRAY_ALLOCATED, MALLOC_ALLOCATED, NONE_ALLOCATED }

Public Member Functions

 scoped_memory ()
 ~scoped_memory ()
void * get () const
const char * begin () const
const char * end () const
std::size_t size () const
Alloc source () const
void reset ()
void reset (void *data, std::size_t size, Alloc from)
void call_realloc (std::size_t to)


Detailed Description

Definition at line 51 of file mmap.hh.


Member Enumeration Documentation

Enumerator:
MMAP_ALLOCATED 
ARRAY_ALLOCATED 
MALLOC_ALLOCATED 
NONE_ALLOCATED 

Definition at line 53 of file mmap.hh.


Constructor & Destructor Documentation

util::scoped_memory::scoped_memory (  )  [inline]

Definition at line 55 of file mmap.hh.

util::scoped_memory::~scoped_memory (  )  [inline]

Definition at line 57 of file mmap.hh.

References reset().

Here is the call graph for this function:


Member Function Documentation

const char* util::scoped_memory::begin (  )  const [inline]

Definition at line 60 of file mmap.hh.

Referenced by util::FilePiece::FilePiece(), and util::FilePiece::Offset().

Here is the caller graph for this function:

void util::scoped_memory::call_realloc ( std::size_t  to  ) 

Definition at line 87 of file mmap.cc.

References MALLOC_ALLOCATED, NONE_ALLOCATED, and reset().

Here is the call graph for this function:

const char* util::scoped_memory::end (  )  const [inline]

Definition at line 61 of file mmap.hh.

void* util::scoped_memory::get (  )  const [inline]

void util::scoped_memory::reset ( void *  data,
std::size_t  size,
Alloc  from 
)

Definition at line 68 of file mmap.cc.

References ARRAY_ALLOCATED, MALLOC_ALLOCATED, MMAP_ALLOCATED, and NONE_ALLOCATED.

void util::scoped_memory::reset (  )  [inline]

Definition at line 66 of file mmap.hh.

References NONE_ALLOCATED, NULL, and reset().

Referenced by call_realloc(), util::FilePiece::FilePiece(), lm::ngram::GrowForSearch(), util::MapAnonymous(), util::MapRead(), reset(), lm::ngram::SetupJustVocab(), and ~scoped_memory().

Here is the call graph for this function:

Here is the caller graph for this function:

std::size_t util::scoped_memory::size (  )  const [inline]

Definition at line 62 of file mmap.hh.

Referenced by lm::ngram::FinishFile(), and lm::ngram::GrowForSearch().

Here is the caller graph for this function:

Alloc util::scoped_memory::source (  )  const [inline]

Definition at line 64 of file mmap.hh.


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

Generated on Mon Apr 21 00:31:49 2014 for Moses by  doxygen 1.5.9