Paul Sokolovsky
1b586f3a73
py: Rename MP_BOOL() to mp_obj_new_bool() for consistency in naming.
9 years ago
Damien George
e1e359ff59
py: Put mp_sys_path, mp_sys_argv and gc_collected in mp_state_ctx_t.
Without mp_sys_path and mp_sys_argv in the root pointer section of the
state, their memory was being incorrectly collected by GC.
10 years ago
Damien George
b4b10fd350
py: Put all global state together in state structures.
This patch consolidates all global variables in py/ core into one place,
in a global structure. Root pointers are all located together to make
GC tracing easier and more efficient.
10 years ago
Damien George
51dfcb4bb7
py: Move to guarded includes, everywhere in py/ core.
Addresses issue #1022 .
10 years ago
Damien George
3b603f29ec
Use MP_DEFINE_CONST_DICT macro to define module dicts.
This is just a clean-up of the code. Generated code is exactly the
same.
10 years ago
Damien George
109c1de015
py: Make gc.enable/disable just control auto-GC; alloc is still allowed.
gc.enable/disable are now the same as CPython: they just control whether
automatic garbage collection is enabled or not. If disabled, you can
still allocate heap memory, and initiate a manual collection.
10 years ago
Damien George
30dd23aa7f
doc: Document gc, sys, math, cmath.
10 years ago
Damien George
bb4c6f35c6
py: Make MP_OBJ_NEW_SMALL_INT cast arg to mp_int_t itself.
Addresses issue #724 .
10 years ago
Damien George
40f3c02682
Rename machine_(u)int_t to mp_(u)int_t.
See discussion in issue #50 .
11 years ago
Paul Sokolovsky
5aa740c3e2
modgc: Add mem_free()/mem_alloc() methods.
Return free/allocated memory on GC heap.
11 years ago
Paul Sokolovsky
59c675a64c
py: Include mpconfig.h before all other includes.
It defines types used by all other headers.
Fixes #691 .
11 years ago
Emmanuel Blot
f6932d6506
Prefix ARRAY_SIZE with micropython prefix MP_
11 years ago
Paul Sokolovsky
380f147d2e
modgc: Real 64-bit cleanness.
11 years ago
Paul Sokolovsky
a3ef8087e8
modgc: 64-bit cleanness.
11 years ago
Paul Sokolovsky
755a55f507
modgc: Implement return value for gc.collect(), enable on Unix.
11 years ago
Damien George
ee3fd46f13
Rename configuration variables controling Python features.
Now of the form MICROPY_PY_*. See issue #35 .
11 years ago
Damien George
8c1c7488b2
Add gc.enable, gc.disable; remove pyb.gc.
11 years ago
Paul Sokolovsky
f9e54e0ea5
modgc: Add new module for GC-related functionality.
11 years ago
Damien George
04b9147e15
Add license header to (almost) all files.
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/.
11 years ago
Paul Sokolovsky
cb9dc086a3
modio: Implement io.StringIO class.
11 years ago
Damien George
6d3c5e4301
Add ARRAY_SIZE macro, and use it where possible.
11 years ago
Damien George
8b0535e23f
py: Change module globals from mp_map_t* to mp_obj_dict_t*.
Towards addressing issue #424 .
Had a small increase to ROM usage (order 60 bytes).
11 years ago
Paul Sokolovsky
98a627dc03
py: Add "io" module.
So far just includes "open" function, which should be supplied by a port.
TODO: Make the module #ifdef'ed.
11 years ago