diff options
| author | Ray <[email protected]> | 2019-04-23 14:55:35 +0200 |
|---|---|---|
| committer | Ray <[email protected]> | 2019-04-23 14:55:35 +0200 |
| commit | e67ebabb02c1068d6e7f5107dcff5388ede3faa5 (patch) | |
| tree | 40820768bec18bc682038f29d6dee6d85fc0e3c9 /src/raudio.h | |
| parent | 8ed71b9d5a90ccca5551aaf069318e3c8b4a87e6 (diff) | |
| download | raylib-e67ebabb02c1068d6e7f5107dcff5388ede3faa5.tar.gz raylib-e67ebabb02c1068d6e7f5107dcff5388ede3faa5.zip | |
Support custom memory management macros
Users can define their custom memory management macros.
NOTE: Most external libraries support custom macros in the same way, raylib should redefine those macros to raylib ones, to unify custom memory loading. That redefinition is only implemented as example for stb_image.h in [textures] module.
Diffstat (limited to 'src/raudio.h')
| -rw-r--r-- | src/raudio.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/raudio.h b/src/raudio.h index e8701814..f71a3083 100644 --- a/src/raudio.h +++ b/src/raudio.h @@ -56,7 +56,16 @@ //---------------------------------------------------------------------------------- // Defines and Macros //---------------------------------------------------------------------------------- -//... +// Allow custom memory allocators +#ifndef RL_MALLOC + #define RL_MALLOC(sz) malloc(sz) +#endif +#ifndef RL_CALLOC + #define RL_CALLOC(n,sz) calloc(n,sz) +#endif +#ifndef RL_FREE + #define RL_FREE(p) free(p) +#endif //---------------------------------------------------------------------------------- // Types and Structures Definition |
