summaryrefslogtreecommitdiff
path: root/py/misc.h
AgeCommit message (Collapse)Author
2014-04-04py: Add m_malloc_fail function to handle memory allocation error.Damien George
A malloc/realloc fail now throws MemoryError.
2014-04-03Implement delmux
2014-04-02py: Wrap compile_scope_inline_asm in #if; remove comment from misc.h.Damien George
2014-03-15Add vstr_ins and vstr_cut_out; improve stmhal readline.Damien George
2014-02-26py: Take out bitfield entries from their own structure.Damien George
Don't need to wrap bitfields in their own struct. Compiler does the correct thing without it.
2014-02-22py: Rename strtonum to mp_strtonum.Damien George
strtonum clashes with BSD function of same name, and our version is different so warrants a unique name. Addresses Issue #305.
2014-02-16Make DEBUG_printf() a proper function, implementation is port-dependent.Paul Sokolovsky
In particular, unix outputs to stderr, to allow to run testsuite against micropython built with debug output (by redirecting stderr to /dev/null).
2014-02-06Implement fixed buffer vstrs; use them for import path.Damien George
2014-02-05Search paths properly on import and execute __init__.py if it exists.Damien George
2014-02-05Implement support for sys.path when loading modules.Paul Sokolovsky
sys.path is not initialized by rt_init(), that's left for platform-specific startup code. (For example, bare metal port may have some hardcoded defaults, and let user change sys.path directly; while port for OS with environment feature can take path from environment). If it's not explicitly initialized, modules will be imported only from a current directory.
2014-02-05Add generic MIN()/MAX() functions.Paul Sokolovsky
2014-01-22Implement octal and hex escapes in strings.Paul Sokolovsky
2014-01-21Revamp qstrs: they now include length and hash.Damien George
Can now have null bytes in strings. Can define ROM qstrs per port using qstrdefsport.h
2014-01-15Merge branch 'str2int' of github.com:xyb/micropython into xyb-str2intDamien George
Conflicts: py/objint.c unix-cpy/Makefile unix/Makefile
2014-01-14Merge pull request #173 from pfalcon/file-readallDamien George
Generic implementation if stream readall() method, immediately reused in unix io.FileIO implementation
2014-01-13Add "buffer management" and "shrink" API calls to vstr.Paul Sokolovsky
vstr is initially intended to deal with arbitrary-length strings. By providing a bit lower-level API calls, it will be also useful to deal with arbitrary-length I/O buffers (the difference from strings is that buffers are filled from "outside", via I/O). Another issue, especially aggravated by I/O buffer use, is alloc size vs actual size length. If allocated 1Mb for buffer, but actually read 1 byte, we don't want to keep rest of 1Mb be locked by this I/O result, but rather return it to heap ASAP ("shrink" buffer before passing it to qstr_from_str_take()).
2014-01-13added zip()John R. Lenton
2014-01-06Revert MP_BOOL, etc. and use <stdbool.h> insteadian-v
2014-01-06Co-exist with C++ (issue #85)ian-v
2014-01-03Add new alloc metric: peak_bytes_allocated.Paul Sokolovsky
This is just max value of current_bytes_allocated seen.
2014-01-03Add new alloc metric: current_bytes_allocated.Paul Sokolovsky
Unlike total_bytes_allocated, this tracks m_free()'s too.
2013-12-30Put unicode functions in unicode.c, and tidy their names.Damien George
2013-12-29Change memory allocation API to require size for free and realloc.Damien
2013-12-21Change object representation from 1 big union to individual structs.Damien
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).
2013-11-03Fixup include of stdarg and va_list definition.Damien
2013-11-03Add simple var-arg functions; add simple string.format.Damien
2013-10-23Fix func decls with no arguments: () -> (void).Damien
2013-10-20Add vstr and its functions.Damien
2013-10-04Initial commit.Damien