diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2005-06-28 11:00:35 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2005-06-28 11:00:35 +0000 |
commit | 07fb877e0a7eb9d87482b68bb45e839fdaf851d8 (patch) | |
tree | 8c7a7af071fcd1e16f87417fcf6515fd917925fa /HACKING | |
parent | f5a180ff4be1599ffc8dae38d97a42242979f809 (diff) | |
download | gpsd-07fb877e0a7eb9d87482b68bb45e839fdaf851d8.tar.gz |
Document that the low-level interface uses no dynamic allocation.
Diffstat (limited to 'HACKING')
-rw-r--r-- | HACKING | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -315,6 +315,16 @@ enough to manage that, consider whether your feature control might be implemented with an extension to the gpsd protocol or the control-socket command set. +** Don't use malloc! + +The best way to avoid having dynamic-memory allocation problems is +not to use malloc/free at all. The gpsd daemon doesn't (though the +client-side code does). Thus, even the longest-running instance +can't have memory leaks. The only cost for this turned out to be +embedding a PATH_MAX-sized buffer in the gpsd.h structure. + +Don't undo this by using malloc/free in a driver or anywhere else. + ** Error modeling To estimate errors (which we must do if the GPS isn't nice like a |