Skip to content

Commit

Permalink
Temporarily switch to deteministic interning keys
Browse files Browse the repository at this point in the history
  • Loading branch information
markflorisson committed Apr 15, 2013
1 parent 18b192b commit 0c17bbc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions extensibletype/methodtable.pyx
Expand Up @@ -142,6 +142,7 @@ cdef class PerfectHashMethodTable(object):
"""
cdef uint64_t prehash = intern.global_intern(make_bytes(signature))

assert 0 <= self.displacements[prehash & self.table.m_g] < self.table.b
cdef uint64_t idx = (((prehash >> self.table.r) & self.table.m_f) ^
self.displacements[prehash & self.table.m_g])

Expand Down
5 changes: 5 additions & 0 deletions include/interning.h
Expand Up @@ -75,6 +75,11 @@ intern_create_table(intern_table_t *table)
table->secrets[i + 0] = ((char *) &randval)[0];
table->secrets[i + 1] = ((char *) &randval)[1];
}
/* Amend this! */
memset(&table->secrets[16*0], 0, 16);
memset(&table->secrets[16*1], 1, 16);
memset(&table->secrets[16*2], 2, 16);
memset(&table->secrets[16*3], 3, 16);

/* _print_secrets(table); */

Expand Down

0 comments on commit 0c17bbc

Please sign in to comment.