pyke/mapping.c, key.c: Make the mapping code more intrusive and complete.
authorMark Wooding <mdw@distorted.org.uk>
Mon, 18 Nov 2019 10:41:12 +0000 (10:41 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 11 Apr 2020 11:44:14 +0000 (12:44 +0100)
commit78daa0e0a7bd479a1618ba5409ef2a187588a941
tree9eff213ae0f268dcbdd111d55b24b7fdb15e0874
parent85d110a41cee7dd8c91e10017068fc39dc99eeb0
pyke/mapping.c, key.c: Make the mapping code more intrusive and complete.

Previously, mapping classes would implement a minimum of Python-level
operations, such as iterating over keys and mapping lookups, and the
generic mapping code would just synthesize missing operations in terms
of these.

Instead, introduce a mapping-specific vtable pointer in object
structures which describes the mapping operations in a form similar to
mLib's `sym' interface, which is rather more efficient in terms of hash
probes, and have the generic mapping code synthesize all of the Python-
level operations from these.

Needless to say, this is very messy.  Sorry.
mapping-mLib.c [new file with mode: 0644]
mapping.c
pyke-mLib.h
pyke.h