Followup and evaluation on the Chumby [entries|reading|network|archive]
simont

[ userinfo | dreamwidth userinfo ]
[ archive | journal archive ]

Mon 2008-05-26 12:23
Followup and evaluation on the Chumby
LinkReply
[personal profile] pm215Mon 2008-05-26 13:40
(from chumby.c)
    pollfds = malloc(npollfds_both * sizeof(*pollfds));
    pollfds[0].fd = touchscreen_fd;
Shouldn't there be a check for malloc failure in there?
Link Reply to this | Parent | Thread
[personal profile] simontMon 2008-05-26 13:45
Fixed :-)

(Not very important in practice: that code only runs once at program startup, and unless I'm doing debugging that's always just after a reboot so the Chumby will pretty reliably have plenty of memory to spare at that point. But thanks anyway.)
Link Reply to this | Parent
[identity profile] deliberateblank.livejournal.comMon 2008-05-26 14:11
Or switch to epoll instead?
Link Reply to this | Parent | Thread
[personal profile] simontMon 2008-05-26 14:37
Gosh, I didn't know about that. My choice of poll was mostly dictated by the ALSA library API, which provides a pre-cooked set of struct pollfds for detecting when more data needs to be sent to the sound device. I suppose I could have read those and translated their contents into my poll-equivalent of choice, but it didn't seem particularly worth doing.

epoll looks like massive overkill for a job this small, anyway!
Link Reply to this | Parent
navigation
[ go | Previous Entry | Next Entry ]
[ add | to Memories ]