(why would it read from PROT_WRITE only memory? silly thing...)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@1447
d7cf8633-e32d-0410-b094-
e92efae38249
else
#endif
{
- memset(shm->buffer, clear, shm->samples * shm->samplebits/8);
+ int setsize = shm->samples * shm->samplebits / 8;
+ char *buf = shm->buffer;
+
+ while (setsize--)
+ *buf++ = 0;
+
+// on i586/i686 optimized versions of glibc, glibc *wrongly* IMO,
+// reads the memory area before writing to it causing a seg fault
+// since the memory is PROT_WRITE only and not PROT_READ|PROT_WRITE
+// memset(shm->buffer, clear, shm->samples * shm->samplebits/8);
}
}