summaryrefslogtreecommitdiff
path: root/HACKING
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2005-06-28 11:00:35 +0000
committerEric S. Raymond <esr@thyrsus.com>2005-06-28 11:00:35 +0000
commit07fb877e0a7eb9d87482b68bb45e839fdaf851d8 (patch)
tree8c7a7af071fcd1e16f87417fcf6515fd917925fa /HACKING
parentf5a180ff4be1599ffc8dae38d97a42242979f809 (diff)
downloadgpsd-07fb877e0a7eb9d87482b68bb45e839fdaf851d8.tar.gz
Document that the low-level interface uses no dynamic allocation.
Diffstat (limited to 'HACKING')
-rw-r--r--HACKING10
1 files changed, 10 insertions, 0 deletions
diff --git a/HACKING b/HACKING
index 9fdc49b9..8b441781 100644
--- a/HACKING
+++ b/HACKING
@@ -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