]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
Added comment about hashtable
authorDale Weiler <killfieldengine@gmail.com>
Fri, 23 Nov 2012 20:05:53 +0000 (20:05 +0000)
committerDale Weiler <killfieldengine@gmail.com>
Fri, 23 Nov 2012 20:05:53 +0000 (20:05 +0000)
gmqcc.h

diff --git a/gmqcc.h b/gmqcc.h
index 5cbf7fe121628c7d8eef80cd400cff2bd22fdce1..f0f67cd2802a7afdd0de7bfa42317a3ba9580de9 100644 (file)
--- a/gmqcc.h
+++ b/gmqcc.h
@@ -270,6 +270,13 @@ typedef struct hash_table_t {
 /*
  * hashtable implementation:
  * 
+ * Note:
+ *      This was designed for pointers:  you manage the life of the object yourself
+ *      if you do use this for non-pointers please be warned that the object may not
+ *      be valid if the duration of it exceeds (i.e on stack).  So you need to allocate
+ *      yourself, or put those in global scope to ensure duration is for the whole
+ *      runtime.
+ * 
  * util_htnew(size)                             -- to make a new hashtable
  * util_htset(table, key, value, sizeof(value)) -- to set something in the table
  * util_htget(table, key)                       -- to get something from the table