aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2016-07-07 10:31:43 -0700
committerChris Robinson <[email protected]>2016-07-07 10:31:43 -0700
commit745cad52315cac31f6ecdb131f710ad60f4f8cac (patch)
treec0bf3cdc9f9f2e930867f4f43145c7a17014bc74
parent7ec89b4b6e787c9bb0b73aea7f736351f1b0bfca (diff)
Avoid standard malloc/free for Hrtf allocation
-rw-r--r--Alc/hrtf.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/Alc/hrtf.c b/Alc/hrtf.c
index eb586d38..8b0bb505 100644
--- a/Alc/hrtf.c
+++ b/Alc/hrtf.c
@@ -31,6 +31,7 @@
#include "hrtf.h"
#include "compat.h"
+#include "almalloc.h"
/* Current data set limits defined by the makehrtf utility. */
@@ -310,7 +311,7 @@ static struct Hrtf *LoadHrtf00(FILE *f, const_al_string filename)
total += sizeof(delays[0])*irCount;
total += al_string_length(filename)+1;
- Hrtf = malloc(total);
+ Hrtf = al_calloc(16, total);
if(Hrtf == NULL)
{
ERR("Out of memory.\n");
@@ -462,7 +463,7 @@ static struct Hrtf *LoadHrtf01(FILE *f, const_al_string filename)
total += sizeof(delays[0])*irCount;
total += al_string_length(filename)+1;
- Hrtf = malloc(total);
+ Hrtf = al_calloc(16, total);
if(Hrtf == NULL)
{
ERR("Out of memory.\n");
@@ -690,7 +691,7 @@ void FreeHrtfs(void)
while(Hrtf != NULL)
{
struct Hrtf *next = Hrtf->next;
- free(Hrtf);
+ al_free(Hrtf);
Hrtf = next;
}
}