Synopsis

PDX_MSGT dar_InitializeArray(DAR_ARRAY *dar, enum dar_array_type type, size_t element_size, size_t init_capacity)

Purpose

Initialize the dynamic array subsystem.

Description

Initializes a dynamic array of elements with the size of element_size. The initial capacity is rounded up to the nearest power of two and is used to preallocate elements.

Input

dar

Array to populate.

type

The type of array. Either DAR_ARRAY or DAR_DIRECTORY.

elemet_size

Size of the elements.

init_capacity

Initial number of elements to allocated.

Return

0, DAR_NOMEMORY, or DAR_BAD_TYPE.