[516] in BarnOwl Developers
[D-O-H] r636 - in trunk: . owl
daemon@ATHENA.MIT.EDU (nelhage@MIT.EDU)
Thu Oct 29 18:07:00 2009
Resent-From: nelhage@mit.edu
Resent-To: barnowl-dev-mtg@charon.mit.edu
To: dirty-owl-hackers@mit.edu
From: nelhage@MIT.EDU
Reply-to: dirty-owl-hackers@MIT.EDU
Date: Wed, 28 Feb 2007 22:31:42 -0500 (EST)
Author: nelhage
Date: 2007-02-28 22:31:42 -0500 (Wed, 28 Feb 2007)
New Revision: 636
Modified:
trunk/
trunk/owl/message.c
trunk/owl/obarray.c
Log:
r19159@phanatique: nelhage | 2007-02-28 22:31:17 -0500
We don't need to free message keys any more.
r19160@phanatique: nelhage | 2007-02-28 22:31:37 -0500
Some explanatory comments in obarray
Property changes on: trunk
___________________________________________________________________
Name: svk:merge
- bb873fd7-8e23-0410-944a-99ec44c633eb:/branches/owl/filter-rewrite:15925
bb873fd7-8e23-0410-944a-99ec44c633eb:/local/d-o-h/trunk:19152
+ bb873fd7-8e23-0410-944a-99ec44c633eb:/branches/owl/filter-rewrite:15925
bb873fd7-8e23-0410-944a-99ec44c633eb:/local/d-o-h/trunk:19160
Modified: trunk/owl/message.c
===================================================================
--- trunk/owl/message.c 2007-03-01 02:07:41 UTC (rev 635)
+++ trunk/owl/message.c 2007-03-01 03:31:42 UTC (rev 636)
@@ -17,7 +17,6 @@
m->id=owl_global_get_nextmsgid(&g);
owl_message_set_direction_none(m);
m->delete=0;
- m->hostname=owl_strdup("");
m->zwriteline=strdup("");
m->invalid_format=1;
@@ -978,7 +977,6 @@
j=owl_list_get_size(&(m->attributes));
for (i=0; i<j; i++) {
p=owl_list_get_element(&(m->attributes), i);
- owl_free(owl_pair_get_key(p));
owl_free(owl_pair_get_value(p));
owl_free(p);
}
Modified: trunk/owl/obarray.c
===================================================================
--- trunk/owl/obarray.c 2007-03-01 02:07:41 UTC (rev 635)
+++ trunk/owl/obarray.c 2007-03-01 03:31:42 UTC (rev 636)
@@ -2,9 +2,16 @@
#include <string.h>
#include "owl.h"
-// Lookup a key in the obarray. If the key exists, return its index,
-// and the interned value in *val. Otherwise, return the index it
-// should be inserted at.
+/*
+ * At the moment, the obarray is represented as a sorted list of
+ * strings. I judge this a reasonable tradeoff between simplicity and
+ * reasonable efficient lookup (insertion should be comparatively
+ * rare)
+ */
+
+// Helper method: Lookup a key in the obarray. If the key exists,
+// return its index, and the interned value in *val. Otherwise, return
+// the index it should be inserted at.
int owl_obarray_lookup(owl_obarray *oa, char * key, char ** val) /*noproto*/
{
int first, last, mid;