Monobjc / monobjc

Git Repository for the Monobjc Project
http://www.monobjc.net/
17 stars 3 forks source link

Cache hashtables use inconsistent keys #390

Closed aarononeal closed 11 years ago

aarononeal commented 11 years ago

Hashtables are defined with string keys:

__WRAPPERS_HASHTABLE = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, NULL); __CONSTRUCTORS_HASHTABLE = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, NULL);

But, strings are not passed to the insert or lookup functions.

g_hash_table_insert(__WRAPPERS_HASHTABLE, type, wrapper_type); g_hash_table_insert(__CONSTRUCTORS_HASHTABLE, klass, constructor);

This may not be as simple as just switching to pointer keys because I'm not sure that type and klass will resolve to the same pointer each invocation. String keys could be used on insert and lookup, though this obviously won't perform as well as int or pointer.