diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2009-11-09 13:44:39 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2009-11-09 13:44:39 -0800 |
commit | 357121301094005f6c56471fb18f9ff1b6bc8d13 (patch) | |
tree | e9b4d47ace9622de678f5c863e473bfa00fd721f /lib.h | |
parent | 10e4d4687df9a41a017fc438bc16407265dfe281 (diff) | |
download | txr-357121301094005f6c56471fb18f9ff1b6bc8d13.tar.gz txr-357121301094005f6c56471fb18f9ff1b6bc8d13.tar.bz2 txr-357121301094005f6c56471fb18f9ff1b6bc8d13.zip |
First cut at hash tables. One known problem is allocation during gc,
due to use of boxed numbers for vector access.
Diffstat (limited to 'lib.h')
-rw-r--r-- | lib.h | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -136,6 +136,7 @@ struct cobj_ops { void (*print)(obj_t *self, obj_t *stream); void (*destroy)(obj_t *self); void (*mark)(obj_t *self); + long (*hash)(obj_t *self); }; union obj { @@ -155,7 +156,7 @@ union obj { extern obj_t *interned_syms; extern obj_t *t, *cons_t, *str_t, *chr_t, *num_t, *sym_t, *fun_t, *vec_t; -extern obj_t *stream_t, *lcons_t, *lstr_t, *cobj_t; +extern obj_t *stream_t, *hash_t, *lcons_t, *lstr_t, *cobj_t; extern obj_t *var, *regex, *set, *cset, *wild, *oneplus; extern obj_t *zeroplus, *optional, *compound, *or, *quasi; extern obj_t *skip, *trailer, *block, *next, *freeform, *fail, *accept; @@ -301,6 +302,7 @@ obj_t *cobj(void *handle, obj_t *cls_sym, struct cobj_ops *ops); void cobj_print_op(obj_t *, obj_t *); /* Default function for struct cobj_ops */ obj_t *assoc(obj_t *list, obj_t *key); obj_t *acons_new(obj_t *list, obj_t *key, obj_t *value); +obj_t **acons_new_l(obj_t **list, obj_t *key); obj_t *alist_remove(obj_t *list, obj_t *keys); obj_t *alist_remove1(obj_t *list, obj_t *key); obj_t *copy_cons(obj_t *cons); |