Files
moonwell-core-vanilla/dep/recastnavigation/Recast/Source/RecastAlloc.cpp
T
ratkosrb 9a30372093 Updates to maps, vmaps and mmaps (#303)
Credits to cmangos and trinitycore projects.

https://github.com/cmangos/mangos-classic/commit/fd6c640c6ef4afe028180e2d9b8ffc73a20ec902
https://github.com/cmangos/mangos-classic/commit/9b48da5237c90f5be471599f594ccfda4fd07eb9
https://github.com/cmangos/mangos-classic/commit/a391308caf0220f3058ccfc5ab77c3e0b0dff3df
https://github.com/cmangos/mangos-classic/commit/def10c862b818c01d947de53167d0c8ed7d81001
https://github.com/cmangos/mangos-classic/commit/46229bb28c6a4362dc4f4ee88e8bdaf962cb1d58
https://github.com/cmangos/mangos-classic/commit/2e7af8455566d7b289c8fa8b00472a9f21ca1494
https://github.com/cmangos/mangos-classic/commit/9cc773b719ddb2498ff91ae9ae90f9cea71f3528
https://github.com/cmangos/mangos-classic/commit/c1d97517b0673769bad1343a0c9f9b24d24ab738
https://github.com/cmangos/mangos-classic/commit/74b1e01542ea3ea65239d1762662134abae43f13
https://github.com/cmangos/mangos-classic/commit/5442ad1d79efc7e3442fd01fdeda9cc7f60b6b64
https://github.com/cmangos/mangos-classic/commit/bfff02bd0eb383c635bf4375695d096080d5c2e0
https://github.com/cmangos/mangos-classic/commit/8daa3ffb6687d38b0912cd19905d03328de82e61
https://github.com/cmangos/mangos-classic/commit/1ede0a03aa61a9d84a883f113baa2c32d27f1a6b
https://github.com/cmangos/mangos-classic/commit/ac5a8a60b8a54da9c3b1739307c14ca0a053f738
https://github.com/cmangos/mangos-classic/commit/48a84fbfb6c30d81fb1b7467b071a1512112d50a
https://github.com/cmangos/mangos-classic/commit/9d4bc6efa615849aa4f936d90fd3f0b40c0a64d2
https://github.com/cmangos/mangos-classic/commit/3db7b9313c52b415230a29d19ddd256d47019a4a
https://github.com/cmangos/mangos-classic/commit/866ec2d489c06c48750774198c2f1ad893c706b3
https://github.com/cmangos/mangos-classic/commit/256cbefafd46a30cc86ab284e86590a469296a14
https://github.com/cmangos/mangos-classic/commit/4b39ff359de2c5a88387634819e58b476ab05202
https://github.com/cmangos/mangos-classic/commit/c6854d16a597fbba3cc27cd8046e418c5cb33d13
https://github.com/cmangos/mangos-classic/commit/7f15528cfc745f38ac23eb4041bb756bdd44234a
https://github.com/cmangos/mangos-classic/commit/1b15fa34d3469a16c7df78a37505d9b5f2bd097e
https://github.com/cmangos/mangos-classic/commit/64a77261091b408d8dcfbbd7869c173263a23efb
https://github.com/cmangos/mangos-classic/commit/7cb695c95826aa7491416fbc285b827c3ff3ebb9
https://github.com/cmangos/mangos-classic/commit/0587095290ce956e42c2d614a83262ae756cc935
https://github.com/cmangos/mangos-classic/commit/09034fb082cca3d60a2cd25aac01a8032c1163e7
https://github.com/cmangos/mangos-classic/commit/9ae1e8bebf36bf94162379c0b4aac27bc2b99636
https://github.com/cmangos/mangos-classic/commit/be83b98f01d5f71e7464bc41c49f74ef0fde009a
https://github.com/cmangos/mangos-classic/commit/26c0877cec74c30498d553f2f933012d7a5aecb2
https://github.com/cmangos/mangos-classic/commit/1b3c8ee3c2dc90b0b0082bf2df640d48c9bcb96c
https://github.com/cmangos/mangos-classic/commit/6a96d69e839fba35d984835b43af7ca37f4b2688
https://github.com/cmangos/mangos-classic/commit/d9853f1d0e11dcd6ca65f911e38227befdcb691b
https://github.com/cmangos/mangos-classic/commit/5afd6a6fd04eec9b61e1bd604b2ef0d910f0b7c2
https://github.com/cmangos/mangos-classic/commit/c3ea0498239e86a6f310458db86ef77090e01eab
https://github.com/cmangos/mangos-classic/commit/35bc62ac2b7bf3c97e780724cc4d14b14837660c
https://github.com/cmangos/mangos-classic/commit/95fcec8517340f729af08d1397728d0552120f88
https://github.com/cmangos/mangos-classic/commit/a09d1e523b59ba33543a64660555a9e990eacfb9
https://github.com/cmangos/mangos-classic/commit/f6107dfc34fc7c2a2fb27f37678d6fc6f8b96802
https://github.com/cmangos/mangos-classic/commit/af2437976b2e5685f9a5e605d92da4088a402f48
https://github.com/cmangos/mangos-classic/commit/e0c98be3e7ea6e00dd2e23dc0d4cbbb5b308521b
https://github.com/cmangos/mangos-classic/commit/ac70b0ef1aec0425e23deca77d761dcf3e9a9a66
https://github.com/cmangos/mangos-classic/commit/0d3fd0d5b8a0710e56a56703e0d8338e33863078
https://github.com/cmangos/mangos-classic/commit/a9393d27649b15398cebaaba01ef05436c6f5ab5
https://github.com/cmangos/mangos-classic/commit/9b38ef751b83cd091267140153a1c383b7c769c4
https://github.com/cmangos/mangos-classic/commit/3208a5e7a722e6d9bd1ee8fae6fc539b55078a7f
https://github.com/TrinityCore/TrinityCore/commit/7ddbc18aafe61434971013ed6126f5666011ab43
https://github.com/TrinityCore/TrinityCore/commit/c602220e02bed1ad76c9e60064eeec5fd97bfe80
https://github.com/TrinityCore/TrinityCore/commit/5a980226497605b18f1855fa39f340c10ee9dd53
2019-11-15 14:35:02 +02:00

61 lines
1.8 KiB
C++

//
// Copyright (c) 2009-2010 Mikko Mononen memon@inside.org
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
//
#include <stdlib.h>
#include <string.h>
#include "RecastAlloc.h"
#include "RecastAssert.h"
static void *rcAllocDefault(size_t size, rcAllocHint)
{
return malloc(size);
}
static void rcFreeDefault(void *ptr)
{
free(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(size_t 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);
}