From 9d677bab7c813927221b534279b0ecf697e95491 Mon Sep 17 00:00:00 2001 From: Dale Weiler Date: Fri, 23 Nov 2012 20:05:53 +0000 Subject: [PATCH] Added comment about hashtable --- gmqcc.h | 7 +++++++ 1 file changed, 7 insertions(+) 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 -- 2.39.2