mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2026-02-11 04:27:44 -05:00
<atlka@pg.gda.pl>
- shm memory patch - optimized a bit sample mixing routines in c and x_86 asm
This commit is contained in:
parent
0f88788f8b
commit
b798d89c0f
5 changed files with 86 additions and 83 deletions
|
|
@ -56,17 +56,6 @@ struct snd_shm_area *snd_shm_area_share(struct snd_shm_area *area)
|
|||
return area;
|
||||
}
|
||||
|
||||
static void _x_destroy(struct snd_shm_area *area)
|
||||
{
|
||||
struct shmid_ds buf;
|
||||
|
||||
shmdt(area->ptr);
|
||||
if (shmctl(area->shmid, IPC_STAT, &buf) >= 0) {
|
||||
if (buf.shm_nattch == 0)
|
||||
shmctl(area->shmid, IPC_RMID, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
int snd_shm_area_destroy(struct snd_shm_area *area)
|
||||
{
|
||||
if (area == NULL)
|
||||
|
|
@ -74,7 +63,7 @@ int snd_shm_area_destroy(struct snd_shm_area *area)
|
|||
if (--area->share)
|
||||
return 0;
|
||||
list_del(&area->list);
|
||||
_x_destroy(area);
|
||||
shmdt(area->ptr);
|
||||
free(area);
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -88,6 +77,6 @@ void snd_shm_area_destructor(void)
|
|||
|
||||
list_for_each(pos, &shm_areas) {
|
||||
area = list_entry(pos, struct snd_shm_area, list);
|
||||
_x_destroy(area);
|
||||
shmdt(area->ptr);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue