aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/alSource.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2017-02-27 20:43:16 -0800
committerChris Robinson <[email protected]>2017-02-27 20:43:16 -0800
commit45d6c34015a5dc971d1e3ca095ad758339c46441 (patch)
tree12ee5ba924f7f56f5eb4ab934649df145a55f67a /OpenAL32/alSource.c
parenta9610b3607e8dd23f731b614c3b0761c38cb36a8 (diff)
Avoid standard malloc for buffer queue entries
Diffstat (limited to 'OpenAL32/alSource.c')
-rw-r--r--OpenAL32/alSource.c14
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;
}