diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-11-26 21:17:16 +0200 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-11-27 17:37:07 +0000 |
commit | e5dbe1e28340a9d1a7b651b35d8de449c46fcf23 (patch) | |
tree | 5214b5ad2f6d335873486892105d7a7a33b72d4e /py/map.c | |
parent | 317cf18486a4791b0322aadcb07c32c6e0a7d0d9 (diff) |
map: Add empty fixed map.
Useful when need to call kw-receiving functions without any keywords
from C, etc.
Diffstat (limited to 'py/map.c')
-rw-r--r-- | py/map.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -34,6 +34,16 @@ #include "obj.h" #include "runtime0.h" +// Fixed empty map. Useful when need to call kw-receiving functions +// without any keywords from C, etc. +const mp_map_t mp_const_empty_map = { + .all_keys_are_qstrs = 0, + .table_is_fixed_array = 1, + .used = 0, + .alloc = 0, + .table = NULL, +}; + // approximatelly doubling primes; made with Mathematica command: Table[Prime[Floor[(1.7)^n]], {n, 3, 24}] // prefixed with zero for the empty case. STATIC uint32_t doubling_primes[] = {0, 7, 19, 43, 89, 179, 347, 647, 1229, 2297, 4243, 7829, 14347, 26017, 47149, 84947, 152443, 273253, 488399, 869927, 1547173, 2745121, 4861607}; |