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>
Mon, 25 Nov 2019 17:43:08 +0000 (17:43 +0000)
commit7c3c492f80f9279506994fbd7491a69f0dc67df3
treeb7d6254fe868a61ddf0fbfb5f4d6af0ff9e6fb4f
parentbfbe5e4064e7e94b71858868f485963e3e7e9ff1
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