[Commotion-admin] [commotiond] Add unsafe tree and list insert functions to commotiond and use where appropriate. (#94)

Josh King notifications at github.com
Tue Feb 25 18:58:05 UTC 2014


Commotiond, for efficiency reasons, tries to avoid doing copies of data structures where possible. Therefore, the network responses to some commands are serialized directly out of the standing data structures where it stores, for instance, profile information. Unfortunately, a recent bugfix revealed that halloc is not behaving as expected, and so some of those standing data structures were getting deleted as responses were getting freed. This pull request adds unsafe versions of the tree and list insert functions, which are functionally identical other than that they don't attempt to hattach new objects to those data structures; memory management is left up to the programmer. These are now used within certain areas of daemon.c so that we can still free all response objects but still access the standing data structures with impunity without worry of freeing them by accident.

To test:
1. Run `commotion help` and verify that the output is as expected.
2. Run it a second time and verify that the 'help' output is identical.
3. Repeat steps 1 and 2 for the 'get', 'profiles' and 'state' commands.
You can merge this Pull Request by running:

  git pull https://github.com/opentechinstitute/commotiond unsafe

Or you can view, comment on it, or merge it online at:

  https://github.com/opentechinstitute/commotiond/pull/94

-- Commit Summary --

  * Add memory-unsafe insert functions to tree object.
  * Add memory-unsafe insert functions to list object.
  * Update daemon.c to use unsafe tree functions where appropriate.

-- File Changes --

    M src/daemon.c (16)
    M src/list.c (104)
    M src/list.h (31)
    M src/tree.c (41)
    M src/tree.h (18)

-- Patch Links --

https://github.com/opentechinstitute/commotiond/pull/94.patch
https://github.com/opentechinstitute/commotiond/pull/94.diff

---
Reply to this email directly or view it on GitHub:
https://github.com/opentechinstitute/commotiond/pull/94
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.chambana.net/pipermail/commotion-admin/attachments/20140225/e2c51b2c/attachment.html>


More information about the Commotion-admin mailing list