Version

menu_open
Warning: you were redirected to the latest documentation corresponding to your major release ( 2023.1.8.8601 ). Should you wish to access your specific version's documentation, please download the offline documentation from the Audiokinetic Launcher and check the Offline Documentation option in Wwise Authoring.
Wwise SDK 2023.1.8

◆ 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 529 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