Cleanup some st.c and hash.c code #107

Closed
wants to merge 10 commits into
from

Projects

None yet

1 participant

@funny-falcon
  1. Remove unused code from st.c and hash.c
  2. Remove unnecessary st_table allocation from hash.c
  3. Move safemode logic from hash.c to st.c to make it clearer
  4. st_shift to optimize Hash#shift
funny-falcon added some commits Mar 24, 2012
@funny-falcon funny-falcon st.c : use real_entries in st_delete for packed tables 0c00999
@funny-falcon funny-falcon st.c : remove ancient check
This check are from initial ordered hash commit when
first entry were created with entry->fore = entry->back = entry
bec6362
@funny-falcon funny-falcon st.c : remove call to iter function with error argument cause it is n…
…ot used

It is not used in hash.c since 2005-03-04
e8be459
@funny-falcon @funny-falcon funny-falcon hash.c : remove unnecessary checks for Qundef in hash iterations
Since hash use st_foreach_check for iterations, such checks are needless
63e622e
@funny-falcon funny-falcon hash.c : do not allocate st_table when it is not necessary b45d21c
@funny-falcon funny-falcon st.c : do not remove entry from chain until cleanup_safe
It allows order of entries to be stable, so that we could
iterate over entries instead of FIND_ENTRY.
It will allow us to introduce safe mode for st_table.
91c3bdb
@funny-falcon funny-falcon * st.c : Save deleted mark as a bit, so that st_delete_safe could be …
…deleted

Embed logic of safe mode and delete mark inside of st_table, so that Hash
could be simplified and st_delete_safe removed at all.
b626324
@funny-falcon funny-falcon * st.c : remove ST_CHECK at all
ST_CHECK were always returned instead of ST_CONTINUE inside
iterator for st_foreach_check, and st_foreach is not supposed
for handling ST_CHECK. So that, unify ST_CONTINUE with ST_CHECK.
92724bd
@funny-falcon funny-falcon st.c : ultra packing st_table eea6088
@funny-falcon

Add removal of ST_CHECK
Add ultrapacking

@funny-falcon funny-falcon st.c : st_shift
There is one natural use case for Hash : unique queue.
One of natural place to use it - lib/thread.rb for use instead of
array in ConditionVariable @waiters.
So lets Hash#shift be as fast as possible?
42b064c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment