static void FreeAllocatedSound(allocated_sound_t *snd) { // Unlink from linked list. AllocatedSoundUnlink(snd); // Keep track of the amount of allocated sound data: allocated_sounds_size -= snd->chunk.alen; free(snd); }
// Lock a sound, to indicate that it may not be freed. static void LockAllocatedSound(allocated_sound_t *snd) { // Increase use count, to stop the sound being freed. ++snd->use_count; // When we use a sound, re-link it into the list at the head, so // that the oldest sounds fall to the end of the list for freeing. AllocatedSoundUnlink(snd); AllocatedSoundLink(snd); }
static void FreeAllocatedSound(allocated_sound_t *snd) { // Unlink from linked list. AllocatedSoundUnlink(snd); // Unlink from higher-level code. snd->sfxinfo->driver_data = NULL; // Keep track of the amount of allocated sound data: allocated_sounds_size -= snd->chunk.alen; free(snd); }