From: Dale Weiler Date: Fri, 23 Nov 2012 20:05:53 +0000 (+0000) Subject: Added comment about hashtable X-Git-Tag: 0.1.9~303 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=9d677bab7c813927221b534279b0ecf697e95491;p=xonotic%2Fgmqcc.git Added comment about hashtable --- diff --git a/gmqcc.h b/gmqcc.h index 5cbf7fe..f0f67cd 100644 --- 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