summaryrefslogtreecommitdiffhomepage
path: root/src/raudio.h
diff options
context:
space:
mode:
authorRay <[email protected]>2019-04-23 14:55:35 +0200
committerRay <[email protected]>2019-04-23 14:55:35 +0200
commite67ebabb02c1068d6e7f5107dcff5388ede3faa5 (patch)
tree40820768bec18bc682038f29d6dee6d85fc0e3c9 /src/raudio.h
parent8ed71b9d5a90ccca5551aaf069318e3c8b4a87e6 (diff)
downloadraylib-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.h11
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