diff options
author | Chris Robinson <[email protected]> | 2017-02-27 20:43:16 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2017-02-27 20:43:16 -0800 |
commit | 45d6c34015a5dc971d1e3ca095ad758339c46441 (patch) | |
tree | 12ee5ba924f7f56f5eb4ab934649df145a55f67a /OpenAL32/alSource.c | |
parent | a9610b3607e8dd23f731b614c3b0761c38cb36a8 (diff) |
Avoid standard malloc for buffer queue entries
Diffstat (limited to 'OpenAL32/alSource.c')
-rw-r--r-- | OpenAL32/alSource.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c index b8345e04..40aa855c 100644 --- a/OpenAL32/alSource.c +++ b/OpenAL32/alSource.c @@ -697,7 +697,7 @@ static ALboolean SetSourceiv(ALsource *Source, ALCcontext *Context, SourceProp p if(buffer != NULL) { /* Add the selected buffer to a one-item queue */ - newlist = malloc(sizeof(ALbufferlistitem)); + newlist = al_calloc(DEF_ALIGN, sizeof(ALbufferlistitem)); newlist->buffer = buffer; newlist->next = NULL; IncrementRef(&buffer->ref); @@ -728,7 +728,7 @@ static ALboolean SetSourceiv(ALsource *Source, ALCcontext *Context, SourceProp p if(temp->buffer) DecrementRef(&temp->buffer->ref); - free(temp); + al_free(temp); } return AL_TRUE; @@ -2545,12 +2545,12 @@ AL_API ALvoid AL_APIENTRY alSourceQueueBuffers(ALuint src, ALsizei nb, const ALu if(!BufferListStart) { - BufferListStart = malloc(sizeof(ALbufferlistitem)); + BufferListStart = al_calloc(DEF_ALIGN, sizeof(ALbufferlistitem)); BufferList = BufferListStart; } else { - BufferList->next = malloc(sizeof(ALbufferlistitem)); + BufferList->next = al_calloc(DEF_ALIGN, sizeof(ALbufferlistitem)); BufferList = BufferList->next; } BufferList->buffer = buffer; @@ -2588,7 +2588,7 @@ AL_API ALvoid AL_APIENTRY alSourceQueueBuffers(ALuint src, ALsizei nb, const ALu DecrementRef(&buffer->ref); ReadUnlock(&buffer->lock); } - free(BufferListStart); + al_free(BufferListStart); BufferListStart = next; } UnlockBuffersRead(device); @@ -2711,7 +2711,7 @@ AL_API ALvoid AL_APIENTRY alSourceUnqueueBuffers(ALuint src, ALsizei nb, ALuint DecrementRef(&buffer->ref); } - free(OldHead); + al_free(OldHead); OldHead = next; } @@ -2832,7 +2832,7 @@ static void DeinitSource(ALsource *source, ALsizei num_sends) ALbufferlistitem *next = BufferList->next; if(BufferList->buffer != NULL) DecrementRef(&BufferList->buffer->ref); - free(BufferList); + al_free(BufferList); BufferList = next; } |