summaryrefslogtreecommitdiffstatshomepage
path: root/py/map.c
Commit message (Collapse)AuthorAge
* py: Make map, dict, set use mp_int_t/mp_uint_t exclusively.Damien George2014-08-30
| | | | Part of code cleanup, towards resolving issue #50.
* Rename machine_(u)int_t to mp_(u)int_t.Damien George2014-07-03
| | | | See discussion in issue #50.
* py: Include mpconfig.h before all other includes.Paul Sokolovsky2014-06-21
| | | | | | It defines types used by all other headers. Fixes #691.
* Add license header to (almost) all files.Damien George2014-05-03
| | | | | | | Blanket wide to all .c and .h files. Some files originating from ST are difficult to deal with (license wise) so it was left out of those. Also merged modpyb.h, modos.h, modstm.h and modtime.h in stmhal/.
* py: Fix bug in map lookup of interned string vs non-interned.Damien George2014-04-28
| | | | | | | Had choice of either interning or forcing full equality comparison, and chose latter. See comments in mp_map_lookup. Addresses issue #523.
* py: Revert revert for allocation policy of set hash table.Damien George2014-04-07
|
* py: Revert change to allocation policy for mp_set_t.Damien George2014-04-07
| | | | Seems that this fixes all set tests.
* py: Fix dict.copy() and low-level map/set allocation.Paul Sokolovsky2014-04-06
| | | | | | | | | | Two things: 1) set flags in copy properly; make mp_map_init() not be too smart and do something with requested alloc size. Policy of using prime numbers for alloc size is high-level policy which should be applied at corresponding high levels. Low-level functions should just do what they're asked to, because they don't have enough context to be smarter than that. For example, munging with alloc size of course breaks dict copying (as changing sizes requires rehashing).
* py: Make mp_map_lookup not allocate memory on removal.Damien George2014-04-05
|
* py: Change module globals from mp_map_t* to mp_obj_dict_t*.Damien George2014-04-05
| | | | | | Towards addressing issue #424. Had a small increase to ROM usage (order 60 bytes).
* py: Fix delete operation on map/dict and set objects.Damien George2014-04-05
| | | | | | Hash table can now be completely full (ie now NULL entry) before a resize is triggered. Use sentinel value to indicate delete entry in the table.
* map: When removing a key, don't NULL the entry, but mark as deleted.Paul Sokolovsky2014-04-05
| | | | | | | | | | When searching next time, such entry should be just skipped, not terminate the search. It's known that marking techique is not efficient at the presense of many removes, but namespace usage should not require many deletes, and as for user dictionaries - well, open addressing map table with linear rehashing and load factor of ~1 is not particularly efficient at all ;-). TODO: May consider "shift other entries in cluster" approach as an alternative.
* map: Add mp_map_dump() (#ifdef'ed) to be handy when debugging maps.Paul Sokolovsky2014-04-05
|
* Merge map.h into obj.h.Damien George2014-03-30
| | | | | | Pretty much everyone needs to include map.h, since it's such an integral part of the Micro Python object implementation. Thus, the definitions are now in obj.h instead. map.h is removed.
* py: Clean up includes.xbe2014-03-17
| | | | Remove unnecessary includes. Add includes that improve portability.
* Replace global "static" -> "STATIC", to allow "analysis builds". Part 2.Paul Sokolovsky2014-02-12
|
* py: Allow mp_map_t to be initialised by a fixed-size, const table.Damien George2014-02-08
| | | | This allows keyword maps to be created directly from stack data.
* Add mp_map_deinit() & mp_map_free() to finalize maps.Paul Sokolovsky2014-01-25
| | | | mp_map_deinit() finalizes static map, mp_map_free() - dynamic.
* Revamp qstrs: they now include length and hash.Damien George2014-01-21
| | | | | Can now have null bytes in strings. Can define ROM qstrs per port using qstrdefsport.h
* Implemented set.removeJohn R. Lenton2014-01-12
|
* Implemented set.discardJohn R. Lenton2014-01-12
|
* Implemented set.clearJohn R. Lenton2014-01-12
|
* py: Stuff qstr in object pointer; keys for mp_map_t are now always mp_obj_t.Damien George2014-01-08
|
* Added dict.setdefaultJohn R. Lenton2014-01-07
|
* implemented dict.popJohn R. Lenton2014-01-07
|
* Added dict.clear.John R. Lenton2014-01-07
| | | | Added 0 to the list of primes. Funky primes, these.
* Change memory allocation API to require size for free and realloc.Damien2013-12-29
|
* Change object representation from 1 big union to individual structs.Damien2013-12-21
| | | | | | | | | | A big change. Micro Python objects are allocated as individual structs with the first element being a pointer to the type information (which is itself an object). This scheme follows CPython. Much more flexible, not necessarily slower, uses same heap memory, and can allocate objects statically. Also change name prefix, from py_ to mp_ (mp for Micro Python).
* py: split runtime into map, obj, builtin.Damien2013-12-17