Function
allocate
Allocates memory from heap.
allocate(object, data, count [, usage_tag])
Include Headers
seqan/basic.h
Parameters

object | Allocator object. Types: Allocator Remarks: object is conceptually the "owner" of the allocated memory. Objects of all types can be used as allocators. If no special behavior is implemented, default functions allocation/deallocation are applied that uses standard new and delete operators.
count | Number of items that could be stored in the allocated memory. The type of the allocated items is given by the type of data.
usage_tag | A tag the specifies the purpose for the allocated memory. Values: Allocator Usage

Remarks
The function allocates at least count*sizeof(data) bytes. The allocated memory is large enough to hold count objects of type T, where T * is type of data.
Note: These objects are not constructed by allocate.
Use e.g. one of the functions valueConstruct, arrayConstruct, arrayConstructCopy or arrayFill to construct the objects. A new operator which is part of the C++ standard (defined in <new>) can also be used to construct objects at a given memory address.
Return Values

data | Pointer to allocated memory. Remarks: The value of this pointer is overwritten by the function.

Example Programs
Allocators
Part of Concept
Allocator
See Also
arrayConstruct, ToStdAllocator, Allocator Usage, arrayFill, clear, arrayConstructCopy, valueConstruct, deallocate
SeqAn - Sequence Analysis Library - www.seqan.de

Page built @2012/03/14 16:34:46