udevd - Big memory and thread cleanup
authorAlex Hornung <ahornung@gmail.com>
Sat, 17 Jul 2010 08:49:20 +0000 (09:49 +0100)
committerAlex Hornung <ahornung@gmail.com>
Sat, 17 Jul 2010 08:54:58 +0000 (09:54 +0100)
commit9ff03f9eb1c21e740304584fcbb2acbd3ca5d766
treee4b9240d579a37194c136f99325c927a86a677b1
parent3bbbc629a1226c53dfdeeb2ea6319b4c0fb8c94c
udevd - Big memory and thread cleanup

* Adjust read_xml() to allocate just the right size of memory, so we
  don't waste anything by allocating 12 MB per client, when the usual
  client xml is a few kB.

* Detach threads so that they can free resources whenever they return
  from their startup function.

* Release the memory associated with a particular iterator and with some
  of the fields in the event filters, which were previously leaking.

* Let the monitor thread check every few (2) seconds if the underlying
  connection is still alive. Previously the threads were staying around
  even after the connection was closed when no event (attach/detach)
  occured.

* Clean up the pdev array on a clean exit so it's easier to find memory
  leaks, since the amount of allocations done by proplib on behalf of
  the pdev stuff is huge.

* Incidentally, don't forget to update the pdev array when a device is
  detached.

Reported-by: Antonio Huete (tuxillo@)
sbin/udevd/udevd.c
sbin/udevd/udevd.h
sbin/udevd/udevd_client.c
sbin/udevd/udevd_monitor.c
sbin/udevd/udevd_pdev.c
sbin/udevd/udevd_socket.c