Skip to content

Commit

Permalink
engine: soundlib: super micro-optimization, reallocate buffer in Imag…
Browse files Browse the repository at this point in the history
…e_Copy rather than allocating and copying
  • Loading branch information
a1batross committed Jul 16, 2024
1 parent a09084c commit 09a7585
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions engine/common/soundlib/snd_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ static byte *Sound_Copy( size_t size )
{
byte *out;

out = Mem_Malloc( host.soundpool, size );
memcpy( out, sound.tempbuffer, size );
out = Mem_Realloc( host.soundpool, sound.tempbuffer, size );
sound.tempbuffer = NULL;

return out;
}
Expand Down

0 comments on commit 09a7585

Please sign in to comment.