diff options
author | Chris Robinson <[email protected]> | 2016-07-07 10:31:43 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2016-07-07 10:31:43 -0700 |
commit | 745cad52315cac31f6ecdb131f710ad60f4f8cac (patch) | |
tree | c0bf3cdc9f9f2e930867f4f43145c7a17014bc74 | |
parent | 7ec89b4b6e787c9bb0b73aea7f736351f1b0bfca (diff) |
Avoid standard malloc/free for Hrtf allocation
-rw-r--r-- | Alc/hrtf.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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; } } |