23 Commits (4891eb9d5f1201ed833ec4d3dbf7fcac0f6e3cc6)

Author SHA1 Message Date
David Chisnall 84c0bfe7b0 Fix two small bugs in the hopscotch hash that meant that moving elements near the end of the array sometimes caused them to become lost. 10 years ago
theraven d7df8c415b Move the selector table to being protected by a mutex for reads so that we can
recover memory from the smaller ones.  Selector lookups are not on the critical
path for message sends, so the cost of the extra memory is likely to be larger
than the cost of acquiring a lock in sel_getName().
13 years ago
theraven 6950cb8e55 A couple of small bug fixes. 14 years ago
theraven 85f1cd713e Tweak cleanup code. 14 years ago
theraven bc87ed22e1 Implemented support for __weak with ARC.
ARC functions are all now exposed in a header, but not yet documented.  See the ARC ABI spec for now:

http://clang.llvm.org/docs/AutomaticReferenceCounting.html#runtime
15 years ago
theraven ff1e691c3b And some more... 15 years ago
theraven 4ffb19230f Make sure that the statics used to store internal tables are marked as roots. 15 years ago
theraven 0c72e2e418 Use typed allocations for the hash table entries. This makes sure that the GC won't treat the jump table bitfield as a pointer.
Store the refcount structures inside the hash table, rather than in a chained structure.  This uses less space and should be easier for the GC to scan (less cache used).
15 years ago
theraven 2d9f41aa94 If we're linking against Boehm GC, then we may as well allow it to collect the runtime's hash tables, rather than doing that manually. 15 years ago
theraven af90153d7f And fix the same bug in the other place. 15 years ago
theraven b9f9ce3bba Fix missing UNLOCK() in hash table. 15 years ago
theraven 8db63b976f Initial work on developer mode (allows classes to be replaced at run time with new versions, by cooperating IDEs). This support is part of ongoing work to provide fix-and-continue functionality with Clang / Cling and LanguageKit. 15 years ago
theraven 7f6f798074 Rewrote some of the class table code to be slightly cleaner. 16 years ago
theraven 2d84b96a72 Tidied up some bits by creating private headers for private data structures.
Imported selector table code frm the Étoilé runtime.  We can now make dispatch type dependent with a -D switch.  Not enabled yet, but it will be enabled in a warning mode soon - I consider preferable to the existing GNU and Apple solution of corrupting the stack.
16 years ago
theraven bfbd52709b Fixed off-by-one error in hash table enumerator, which was causing one class to fail to be resolved. 16 years ago
rfm 5786a73e46 I'm pretty sure that, when resizing a table, we want to copy the non-null nodes rather than the null ones. 16 years ago
theraven 81f0c58a86 Fixed const warning. 16 years ago
theraven 7c03c0d3f1 Fixed double-free problems in GCKit. Fixed removal from hash tables. Added enumerator helper for when you remove objects from a map while enumerating. Removed tracing statements that were identifying bugs that have now been fixed. 16 years ago
theraven 8642bf7b8d Fixed statement order in hash_table.h 16 years ago
theraven 5b1911b4f4 Initial commit of GCKit (moved from Étoilé and the missing 90% mostly implemented). GCKit implements cycle detection on the heap and tracing on the stack and designated heap regions, with support for weak references. It is designed for implementing OS X 10.5-compatible GC semantics.
Although GCKit is mostly finished, it is still not well tested.  It contains bugs, and possibly dragons.  Do not use it.  If you disregard this advice, do not file any bug reports.  If you disregard this instruction, then I will point and laugh at you.
16 years ago
theraven c1a637a990 Allowed hash tables to dynamically resize. This uses toydispatch to free the old version of the table after copying all of the data into the new one, after waiting enough time to allow all potential readers to finish. There are theoretical cases when this can fail, but hopefully no practical ones. The theoretical cases can be removed by making the garbage thread run at a lower priority than all of the other threads in the system.
The protocols table and the class table will now grow as required.  Protocols are now added to the protocols table as they are created, so you should get something sensible and introspectable back when you look up a protocol by name.
16 years ago
theraven 8310615a7c Bug fixes in hash_table.h 16 years ago
theraven bdf97cf64e Added hopscotch table implementation and rewrote the class table to use it. This is done so that the class table and protocol tables can share the same code (currently there is no protocol table).
Note that concurrent resizing has not yet been implemented.  That means that there is a hard limit on the number of classes that can be loaded.  This is currently set to quite a small number for testing, to stress the hash table.  If you're experiencing problems as a result, then please let me know and I will increase it.
16 years ago