diff options
| author | Shauren <shauren.trinity@gmail.com> | 2013-06-18 21:04:31 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2013-06-18 21:04:31 +0200 |
| commit | f517467817207a75cbe395ec96de2dceb0cac5da (patch) | |
| tree | 80457050fd0d460565895aba21ba285cbf323f86 /dep/recastnavigation/Recast/RecastAlloc.cpp | |
| parent | 3367dd5be93b8e63dce41fe6e303aa8ec41a43db (diff) | |
| parent | 89ec90753914ae89b2dbbc7a343cd8a667410af3 (diff) | |
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Diffstat (limited to 'dep/recastnavigation/Recast/RecastAlloc.cpp')
| -rw-r--r-- | dep/recastnavigation/Recast/RecastAlloc.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/dep/recastnavigation/Recast/RecastAlloc.cpp b/dep/recastnavigation/Recast/RecastAlloc.cpp index 2c7396a1bfa..b5ec1516146 100644 --- a/dep/recastnavigation/Recast/RecastAlloc.cpp +++ b/dep/recastnavigation/Recast/RecastAlloc.cpp @@ -33,24 +33,45 @@ static void rcFreeDefault(void *ptr) static rcAllocFunc* sRecastAllocFunc = rcAllocDefault; static rcFreeFunc* sRecastFreeFunc = rcFreeDefault; +/// @see rcAlloc, rcFree void rcAllocSetCustom(rcAllocFunc *allocFunc, rcFreeFunc *freeFunc) { sRecastAllocFunc = allocFunc ? allocFunc : rcAllocDefault; sRecastFreeFunc = freeFunc ? freeFunc : rcFreeDefault; } +/// @see rcAllocSetCustom void* rcAlloc(int size, rcAllocHint hint) { return sRecastAllocFunc(size, hint); } +/// @par +/// +/// @warning This function leaves the value of @p ptr unchanged. So it still +/// points to the same (now invalid) location, and not to null. +/// +/// @see rcAllocSetCustom void rcFree(void* ptr) { if (ptr) sRecastFreeFunc(ptr); } +/// @class rcIntArray +/// +/// While it is possible to pre-allocate a specific array size during +/// construction or by using the #resize method, certain methods will +/// automatically resize the array as needed. +/// +/// @warning The array memory is not initialized to zero when the size is +/// manually set during construction or when using #resize. +/// @par +/// +/// Using this method ensures the array is at least large enough to hold +/// the specified number of elements. This can improve performance by +/// avoiding auto-resizing during use. void rcIntArray::resize(int n) { if (n > m_cap) |
