Paul Sokolovsky
ef18102b9e
Make it possible to turn off collecting memory stats (MICROPY_MEM_STATS).
11 years ago
Paul Sokolovsky
780f555b2e
Add new alloc metric: peak_bytes_allocated.
This is just max value of current_bytes_allocated seen.
11 years ago
Paul Sokolovsky
02de0c57d2
Add new alloc metric: current_bytes_allocated.
Unlike total_bytes_allocated, this tracks m_free()'s too.
11 years ago
Paul Sokolovsky
43f1c8080a
m_realloc: Account only allocation size difference in total_bytes_allocated.
11 years ago
Damien George
1fb031744f
Change mp_compile so that it returns a function object for the module.
11 years ago
Damien George
14f945c2ca
Add note about implementing inplace operators.
11 years ago
Damien George
66028ab6dc
Basic implementation of import.
import works for simple cases. Still work to do on finding the right
script, and setting globals/locals correctly when running an imported
function.
11 years ago
John R. Lenton
9bc56d933f
Changed to use memcpy.
11 years ago
John R. Lenton
aeb16c36b0
Add a bit of whitespace.
11 years ago
John R. Lenton
81ad89c46e
untabified
11 years ago
John R. Lenton
4cb80582c4
Add list addition ( fixes : #39 )
11 years ago
Damien George
aae7847508
Change old use of module creation to new proper use.
11 years ago
Damien George
2870862601
Add module object, to be used eventually for import.
11 years ago
Damien George
0ff883904a
py: Fix generator where state array was incorrectly indexed.
Generator objects now allocate the object and the state in one malloc.
This improvement fixes Issue #38 .
11 years ago
Damien George
ebd2e8702d
py: __MACH__ also uses MAP_ANON.
11 years ago
Damien George
66327006fc
py: change negative array indices with array - 1.
11 years ago
Damien George
27bf5b829b
py: Add more bytecodes to showbc.c.
11 years ago
Paul Sokolovsky
bdf822b3d8
Add quick impl for MP_BC_LOAD_CONST_BYTES which just creates qstr so far.
This is based on the fact that qstr so far behaves more like byte string
than like Unicode string (for example, "012"[0] returns 48 (int)).
11 years ago
Damien George
fe8fb9165c
py: remove depedence on strcat and stpcpy.
This fixes Issue #29 , and means the core is no longer dependent on
string functions, except strlen.
11 years ago
Damien George
40563d56bd
py: Add framework for built-in "type()" function.
11 years ago
Edd Barrett
67ab5ee779
On OpenBSD MAP_ANONYMOUS is called MAP_ANON.
11 years ago
Damien George
df884fe4cc
py: change declaration of mp_map_t in obj.h (for issue #24 ).
11 years ago
Damien George
209d1b1835
py: add int() and float() built-ins, partially implemented.
11 years ago
Damien George
6baf76e28b
py: make closures work.
11 years ago
Paul Sokolovsky
2efbc622cb
Typo fix in comment.
11 years ago
Damien George
8cc96a35e5
Put unicode functions in unicode.c, and tidy their names.
11 years ago
Damien George
212c296c0b
Make unix-cpy cross platform; remove dependency of asmx64 on mpconfig.
11 years ago
Paul Sokolovsky
e85c38992d
Make "unix" target be crossplatform and support x86, x64, ARM hosts.
11 years ago
Damien
dae7eb7226
py: add dict length function, and fix rt_store_set.
11 years ago
Damien
732407f1bf
Change memory allocation API to require size for free and realloc.
11 years ago
Damien
02a7c41e76
py: implement POP_BLOCK in VM.
11 years ago
Paul Sokolovsky
44d0f3cfa2
Handle return value of read() call.
11 years ago
Damien
de690d128b
Add unix-cpy, used to test Micro Python byte code against CPython.
11 years ago
Damien
b86e3f9293
py: implement some basic exception matching.
11 years ago
Damien
8f9e2ee157
Add code in VM to handle nested exceptions correctly.
11 years ago
Damien
dd12d1378f
Parse upper-case hex numbers correctly.
11 years ago
Damien
d9d6201b52
py: simplify __next__ method for generators.
11 years ago
Damien
d99b05282d
Change object representation from 1 big union to individual structs.
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).
11 years ago
Damien
e2880aa2fd
Fix a few compiler warnings.
11 years ago
Damien
a3dcd9e80c
py: add more Python built-in functions.
11 years ago
Damien
660365e14c
py: split runtime into map, obj, builtin.
11 years ago
Damien
a1b2693161
py: remove further unnecessary emit_verbatim code.
11 years ago
Damien
e388f1034e
py: fix bug with doc string not recognised after first newline of file.
11 years ago
Damien
02f8941bf6
py: reduce use of emit_verbatim calls to minimum.
11 years ago
Damien
9ecbcfff99
py: work towards working closures.
11 years ago
Damien
318aec6ba9
py: emit correct id for closed over variables.
11 years ago
Damien
6332174ab4
py: compiler supports string juxtaposition=concatenation.
11 years ago
Damien
db4c361f1c
py: add skeletal import functionality.
11 years ago
Damien
033d17a633
py: built-in range now accepts variable number of arguments.
11 years ago
Damien
d79338969b
py: restrict further when for-range optimisation is done.
11 years ago