mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-17 22:50:51 +00:00
round the mmap length up to the nearest page size
This commit is contained in:
parent
95ae17acc1
commit
06608fbf37
1 changed files with 5 additions and 2 deletions
|
@ -264,8 +264,11 @@ SNDDMA_Init (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mmaped_io) { // memory map the dma buffer
|
if (mmaped_io) { // memory map the dma buffer
|
||||||
shm->buffer = (byte *) mmap (NULL, info.fragstotal * info.fragsize,
|
unsigned long sz = sysconf (_SC_PAGESIZE);
|
||||||
mmmode, mmflags, audio_fd, 0);
|
unsigned long len = info.fragstotal * info.fragsize;
|
||||||
|
|
||||||
|
len = (len + sz - 1) & ~(sz - 1);
|
||||||
|
shm->buffer = (byte *) mmap (NULL, len, mmmode, mmflags, audio_fd, 0);
|
||||||
if (shm->buffer == MAP_FAILED) {
|
if (shm->buffer == MAP_FAILED) {
|
||||||
perror (snd_dev);
|
perror (snd_dev);
|
||||||
Sys_Printf ("Could not mmap %s\n", snd_dev);
|
Sys_Printf ("Could not mmap %s\n", snd_dev);
|
||||||
|
|
Loading…
Reference in a new issue