summaryrefslogtreecommitdiffstatshomepage
path: root/py/misc.h
Commit message (Collapse)AuthorAge
* py: Add generic helper to align a pointer.Paul Sokolovsky2014-07-12
|
* Rename machine_(u)int_t to mp_(u)int_t.Damien George2014-07-03
| | | | See discussion in issue #50.
* py: Make unichar_charlen() accept/return machine_uint_t.Paul Sokolovsky2014-06-28
|
* py: Small comments, name changes, use of machine_int_t.Damien George2014-06-28
|
* misc: Add count_lead_ones() function, useful for UTF-8 handling.Paul Sokolovsky2014-06-27
|
* py: Implement basic unicode functions.Chris Angelico2014-06-27
|
* Prefix ARRAY_SIZE with micropython prefix MP_Emmanuel Blot2014-06-19
|
* unicode: Add trivial implementation of unichar_charlen().Paul Sokolovsky2014-06-14
|
* unicode: String API is const byte*.Paul Sokolovsky2014-06-14
| | | | | We still have that char vs byte dichotomy, but majority of string operations now use byte.
* add methods isspace(), isalpha(), isdigit(), isupper() and islower() to strKim Bauters2014-05-31
|
* objstr: Implement .lower() and .upper().Paul Sokolovsky2014-05-10
|
* py: Improve handling of memory error in parser.Damien George2014-05-10
| | | | | | | | | | | Parser shouldn't raise exceptions, so needs to check when memory allocation fails. This patch does that for the initial set up of the parser state. Also, we now put the parser object on the stack. It's small enough to go there instead of on the heap. This partially addresses issue #558.
* py, unix: Add -v option, print bytecode dump if used.Paul Sokolovsky2014-05-05
| | | | | | | | | | This will work if MICROPY_DEBUG_PRINTERS is defined, which is only for unix/windows ports. This makes it convenient to user uPy normally, but easily get bytecode dump on the spot if needed, without constant recompiles back and forth. TODO: Add more useful debug output, adjust verbosity level on which specifically bytecode dump happens.
* 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/.
* Add ARRAY_SIZE macro, and use it where possible.Damien George2014-04-26
|
* py: Check explicitly for memory allocation failure in parser.Damien George2014-04-10
| | | | | | Previously, a failed malloc/realloc would throw an exception, which was not caught. I think it's better to keep the parser free from NLR (exception throwing), hence this patch.
* py: Add emergency exception object for when heap allocation fails.Damien George2014-04-10
|
* Improve GC finalisation code; add option to disable it.Damien George2014-04-05
|
* Merge pull request #425 from iabdalkader/delDamien George2014-04-05
|\ | | | | Implement del
| * Implement delmux2014-04-03
| |
* | py: Add m_malloc_fail function to handle memory allocation error.Damien George2014-04-04
|/ | | | A malloc/realloc fail now throws MemoryError.
* py: Wrap compile_scope_inline_asm in #if; remove comment from misc.h.Damien George2014-04-02
|
* Add vstr_ins and vstr_cut_out; improve stmhal readline.Damien George2014-03-15
|
* py: Take out bitfield entries from their own structure.Damien George2014-02-26
| | | | | Don't need to wrap bitfields in their own struct. Compiler does the correct thing without it.
* py: Rename strtonum to mp_strtonum.Damien George2014-02-22
| | | | | strtonum clashes with BSD function of same name, and our version is different so warrants a unique name. Addresses Issue #305.
* Make DEBUG_printf() a proper function, implementation is port-dependent.Paul Sokolovsky2014-02-16
| | | | | In particular, unix outputs to stderr, to allow to run testsuite against micropython built with debug output (by redirecting stderr to /dev/null).
* Implement fixed buffer vstrs; use them for import path.Damien George2014-02-06
|
* Search paths properly on import and execute __init__.py if it exists.Damien George2014-02-05
|
* Implement support for sys.path when loading modules.Paul Sokolovsky2014-02-05
| | | | | | | | 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.
* Add generic MIN()/MAX() functions.Paul Sokolovsky2014-02-05
|
* Implement octal and hex escapes in strings.Paul Sokolovsky2014-01-22
|
* 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
* Merge branch 'str2int' of github.com:xyb/micropython into xyb-str2intDamien George2014-01-15
|\ | | | | | | | | | | | | Conflicts: py/objint.c unix-cpy/Makefile unix/Makefile
* \ Merge pull request #173 from pfalcon/file-readallDamien George2014-01-14
|\ \ | | | | | | Generic implementation if stream readall() method, immediately reused in unix io.FileIO implementation
| * | Add "buffer management" and "shrink" API calls to vstr.Paul Sokolovsky2014-01-13
| |/ | | | | | | | | | | | | | | | | | | | | | | | | 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()).
* / added zip()John R. Lenton2014-01-13
|/
* Revert MP_BOOL, etc. and use <stdbool.h> insteadian-v2014-01-06
|
* Co-exist with C++ (issue #85)ian-v2014-01-06
|
* Add new alloc metric: peak_bytes_allocated.Paul Sokolovsky2014-01-03
| | | | This is just max value of current_bytes_allocated seen.
* Add new alloc metric: current_bytes_allocated.Paul Sokolovsky2014-01-03
| | | | Unlike total_bytes_allocated, this tracks m_free()'s too.
* Put unicode functions in unicode.c, and tidy their names.Damien George2013-12-30
|
* 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).
* Fixup include of stdarg and va_list definition.Damien2013-11-03
|
* Add simple var-arg functions; add simple string.format.Damien2013-11-03
|
* Fix func decls with no arguments: () -> (void).Damien2013-10-23
|
* Add vstr and its functions.Damien2013-10-20
|
* Initial commit.Damien2013-10-04