#include <mmap.hh>
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) |
Definition at line 51 of file mmap.hh.
| util::scoped_memory::~scoped_memory | ( | ) | [inline] |
| 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().

| 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().

| void* util::scoped_memory::get | ( | ) | const [inline] |
Definition at line 59 of file mmap.hh.
Referenced by lm::ngram::trie::BuildTrie(), lm::ngram::FinishFile(), lm::ngram::GrowForSearch(), lm::ngram::detail::IsBinaryFormat(), util::MapRead(), lm::ngram::detail::SetupBinary(), lm::ngram::SetupJustVocab(), and lm::builder::VocabReconstitute::VocabReconstitute().

| 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().


| 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().

1.5.9