29 assert(req->get_file() ==
this);
30 offset_type offset = req->get_offset();
31 void* buffer = req->get_buffer();
35 if (type == request::READ)
38 memcpy(buffer, ptr + offset, bytes);
43 memcpy(ptr + offset, buffer, bytes);
47 const char* mem_file::io_type()
const
68 void mem_file::set_size(offset_type newsize)
73 ptr = (
char*)realloc(ptr, (
size_t)newsize);
80 #ifndef STXXL_MEMFILE_DONT_CLEAR_FREED_MEMORY
91 memcpy(ptr + offset, uninitialized, (
size_t)size);
static const int bytes
number of bytes in uint_pair
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
void discard(StreamAlgorithm_ &in)
Reads stream content and discards it. Useful where you do not need the processed stream anymore...
request::offset_type offset_type
the offset of a request, also the size of the file
Request with basic properties like file and offset.
#define STXXL_END_NAMESPACE