diff extra_rwops.h @ 485:137c0b00ea4c

Added Sound_NewSampleFromMem(), and implementation of RWops pooling.
author Ryan C. Gordon <icculus@icculus.org>
date Sun, 27 Feb 2005 19:53:25 +0000
parents 47cc2de2ae36
children c7ab783f05d3
line wrap: on
line diff
--- a/extra_rwops.h	Sun Feb 27 19:50:54 2005 +0000
+++ b/extra_rwops.h	Sun Feb 27 19:53:25 2005 +0000
@@ -61,6 +61,24 @@
 /* Increment a reference counting RWops's refcount by one. */
 void RWops_RWRefCounter_addRef(SDL_RWops *rw);
 
+
+/*
+ * RWops pooling. This is to reduce malloc() pressure for audio that is
+ *  placed into Sound_Samples over and over again.
+ */
+
+/* Call this first. */
+int RWops_pooled_init(void);
+
+/* Call this last. */
+int RWops_pooled_deinit(void);
+
+/* Get a new RWops, allocating if needed. */
+SDL_RWops *RWops_pooled_alloc(void);
+
+/* Return a RWops to the pool for reuse. */
+void RWops_pooled_free(SDL_RWops *rw)
+
 #ifdef __cplusplus
 }
 #endif