summaryrefslogtreecommitdiffstats
path: root/hash.c
Commit message (Collapse)AuthorAgeFilesLines
* Fixing weak hash tables.Kaz Kylheku2010-01-251-5/+14
|
* * hash.c (sethash): New function.Kaz Kylheku2009-12-091-0/+7
| | | | | | | | * hash.h (sethash): Declared. * lib.c (cobj_handle): New function. * lib.h (cobj_handle): Declared.
* All COBJ operations have default implementations now;Kaz Kylheku2009-12-081-9/+7
| | | | | | no null pointer check over struct cobj_ops operations. New typechecking function for COBJ objects.
* Eliminate the void * disease. Generic pointers are of mem_t *Kaz Kylheku2009-12-041-1/+1
| | | | | from now on, which is compatible with unsigned char *. No implicit conversion to or from this type, in C or C++.
* Code cleanup. All private functions static. Private stuffKaz Kylheku2009-11-281-4/+4
| | | | in regex module not exposed in header. Etc.
* Fix uninitialized memory locations.Kaz Kylheku2009-11-241-0/+1
|
* Renaming global variables that denote symbols, such that theyKaz Kylheku2009-11-241-1/+1
| | | | have a _s suffix.
* Improving portability. It is no longer assumed that pointersKaz Kylheku2009-11-231-12/+13
| | | | | | | | can be converted to a type long and vice versa. The configure script tries to detect the appropriate type to use. Also, some run-time checking is performed in the streams module to detect which conversions specifier strings to use for printing numbers.
* Introducing symbol packages. Internal symbols are now inKaz Kylheku2009-11-211-2/+3
| | | | | | | | | | a system package instead of being hacked with the $ prefix. Keyword symbols are provided. In the matcher, evaluation is tightened up. Keywords, nil and t are not bindeable, and errors are thrown if attempts are made to bind them. Destructuring in dest_bind is strict in the number of items. String streams are exploited to print bindings to objects that are not strings or characters. Numerous bugfixes.
* Changing ``obj_t *'' occurences to a ``val'' typedef. (Ideally,Kaz Kylheku2009-11-201-46/+46
| | | | | we wouldn't have to declare object variables at all, so why use an obtuse syntax to do so?)
* Warning fixes.Kaz Kylheku2009-11-171-0/+1
|
* Use the 11 tag bit pattern to denote a new type: LIT. This is aKaz Kylheku2009-11-161-0/+2
| | | | | pointer to a C static string, intended for literals. We can now treat literal strings as light-weight objects.
* Version 021 preparation.txr-021Kaz Kylheku2009-11-151-2/+2
| | | | Bumped version numbers, and cleaned up trailing whitespace from some files.
* Fixes for bug 28086. When constructing a cobj, whose associatedKaz Kylheku2009-11-141-3/+8
| | | | | | | | | | | | | | | | | C structure contains obj_t * references, we should initialize that C structure after allocating the cobj. If we initialize the structure first, it may end up having the /only/ references to the objects. In that case, the objects are invisible to the garbage collector. The subsquent allocation of the cobj itself then may invoke gc which will turn these objects into dust. The result is a cobj which contains a handle structure that contains references to free objects. The fix is to allocate the handle structure, then the cobj which is associated with that handle, and then initialize the handle, at which point it is okay if the handle has the only references to some objects. Care must be taken not to let a cobj escape with a partially initialized handle structure, and not to trigger gc between allocating the cobj, and initializing the fields.
* Big conversion to wide characters and UTF-8 support.Kaz Kylheku2009-11-111-1/+1
| | | | | | | | | This is incomplete. There are too many dependencies on wide character support from the C stream I/O library, and implicit use of some encoding which may not be UTF-8. The regex code does not handle wide characters properly. Character type is still int in some places, rather than wchar_t. Test suite passes though.
* hash.c (hash_grow): Rewritten to avoid resizing the vectorKaz Kylheku2009-11-101-16/+19
| | | | | | | in place, and thus having to pulling all conses into a big list. TODO: avoid recomputing the hash function over the keys. We could enhance cons cells with two more fields without using additional storage.
* Changing representation of objects to allow for unboxed characters.Kaz Kylheku2009-11-091-1/+1
| | | | | Now numbers and characters fit into a cell. We lose one more bit from the range of numbers.
* Add hash removal.Kaz Kylheku2009-11-091-0/+10
|
* Add hash table growth.Kaz Kylheku2009-11-091-2/+32
|
* Changing representation of objects to allow the NUM type to beKaz Kylheku2009-11-091-10/+10
| | | | | | | | unboxed. If the lowest bit of the obj_t * pointer is 1, then the remaining bits are a number. A lot of assumptions are made: - the long type can be converted to and from a pointer - two's complement. - behavior of << and >> operators when the sign bit is involved.
* First cut at hash tables. One known problem is allocation during gc,Kaz Kylheku2009-11-091-0/+301
due to use of boxed numbers for vector access.