Version

menu_open
Wwise SDK 2022.1.12

◆ Reserve()

template<class T , class ARG_T , class TAlloc = ArrayPoolDefault, class TGrowBy = AkGrowByPolicy_DEFAULT, class TMovePolicy = AkAssignmentMovePolicy<T>>
AKRESULT AkArray< T, ARG_T, TAlloc, TGrowBy, TMovePolicy >::Reserve ( AkUInt32  in_ulReserve)
inline

Ensure preallocation of a number of items.

Reserve() won't change the Length() of the array and does nothing if in_ulReserve is smaller or equal to current Reserved() size.

If an allocation occurs, i.e. in_ulReserve > Reserved(), all iterators and all references to the array elements are invalidated.

Note
When template parameter TGrowBy = AkGrowByPolicy_NoGrow, Reserve() shall only be called if the current reserved size is zero. It should normally only be called once on init.
When template parameter TGrowBy = AkGrowByPolicy_Proportional, inappropriate calls to Reserve(), e.g. calling it before every AddLast(), may increase the number of reallocations and result in decreased performance.

Definition at line 512 of file AkArray.h.

Referenced by AkArray< T_MAPSTRUCT *, T_MAPSTRUCT *, ArrayPoolDefault, AkGrowByPolicy_NoGrow >::ReserveExtra().


Was this page helpful?

Need Support?

Questions? Problems? Need more info? Contact us, and we can help!

Visit our Support page

Tell us about your project. We're here to help.

Register your project and we'll help you get started with no strings attached!

Get started with Wwise