Node:Memory Handling Primitives, Next:Bibliography, Previous:Adaptors, Up:Top
| T* allocate (ptrdiff_t n, T*) | Function |
To obtain a typed pointer to an uninitialized memory buffer of a given
size the following function is defined:
The size (in bytes) of the allocated buffer is no less thantemplate n*sizeof(T).
For every memory model there is a corresponding allocate template
function defined with the first argument type being the distance type of
the pointers in the memory model.
|
templateinline T __huge* allocate(long long n, T __huge *);
| deallocate (T* buffer) | Function |
| construct (T1* p, const T2& value) | Function |
| destroy (T* pointer) | Function |
| Also, the following functions are provided: |
templateinline void deallocate(T* buffer); template inline void construct(T1* p, const T2& value) { new (p) T1(value); } template inline void destroy(T* pointer) { pointer->~T(); }
deallocate frees the buffer allocated by allocate.
For every memory
model there are corresponding
deallocate, construct and destroy template
functions defined with the first argument type being the pointer type of
the memory model.
| pair<T*, ptrdiff_t> get_temporary_buffer (ptrdiff_t n, T*) | Function |
| void return_temporary_buffer (T* p) | Function |
templatepair get_temporary_buffer(ptrdiff_t n, T*); template void return_temporary_buffer(T* p);
get_temporary_buffer finds the largest buffer not greater than
n*sizeof(T), and returns a pair consisting of the address and the
capacity (in the units of sizeof(T)) of the
buffer.
return_temporary_buffer returns the buffer allocated by
get_temporary_buffer.