inotifyHandleEvents: Reduce buffer size to avoid huge memory consumption
commitf18567db9ad94cf732cf84caa95f92fe2b653545
authorCarlos R. Mafra <crmafra@gmail.com>
Mon, 17 Aug 2009 22:30:17 +0000 (18 00:30 +0200)
committerCarlos R. Mafra <crmafra@gmail.com>
Mon, 17 Aug 2009 22:39:45 +0000 (18 00:39 +0200)
tree722f5c02ecaa37aec08e9f6c00ef8e42b71c1881
parentbe0d694dc2c1e86b931afc7b2cf0eff9f157b992
inotifyHandleEvents: Reduce buffer size to avoid huge memory consumption

inotifyHandleEvents() was allocating a buffer of size

 (sizeof(struct inotify_event) + FILENAME_MAX)*1024

where FILENAME_MAX is #defined to be 4096 in stdio_lim.h, therefore
it was more than 4 MB!

Reduce it by using 16 instead of FILENAME_MAX and 512 instead of 1024.

Now valgrind does not complain about things like

Invalid write of size 8
 at 0x42002F: inotifyHandleEvents (event.c:323)
 by 0x7FF00020F: ???
 Address 0x7febfc148 is on thread 1's stack

I also made some small coding style changes.
src/event.c