28 if (type == request::READ)
31 memcpy(buffer, m_ptr + offset, bytes);
36 memcpy(m_ptr + offset, buffer, bytes);
40 const char* mem_file::io_type()
const
61 void mem_file::set_size(offset_type newsize)
66 m_ptr = (
char*)
realloc(m_ptr, (
size_t)newsize);
73 #ifndef STXXL_MEMFILE_DONT_CLEAR_FREED_MEMORY
84 memcpy(m_ptr + offset, uninitialized, (
size_t)size);
void * malloc(size_t size)
void * realloc(void *ptr, size_t size)
#define STXXL_BLOCK_ALIGN
request::size_type size_type
the size of a request
Aquire a lock that's valid until the end of scope.
#define STXXL_BEGIN_NAMESPACE
void STXXL_UNUSED(const U &)
static uint_pair max()
return an uint_pair instance containing the largest value possible
static const size_t bytes
number of bytes in uint_pair
request::offset_type offset_type
the offset of a request, also the size of the file
void discard(StreamAlgorithm &in)
Reads stream content and discards it. Useful where you do not need the processed stream anymore...
#define STXXL_END_NAMESPACE