- Apr 10, 2016
-
-
Damien George authored
Saves 16 bytes of code. Also, use mp_obj_get_int_truncated to allow integers as big as a machine word to be passed as the value.
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
Will call underlying C virtual methods of stream interface. This isn't intended to be added to every stream object (it's not in CPython), but is convenient way to expose extra operation on Python side without adding bunch of Python-level methods.
-
- Mar 27, 2016
-
-
Paul Sokolovsky authored
-
- Mar 24, 2016
-
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
Spools entire output buffer to a blocking stream (chunk by chunk if needed).
-
- Jan 11, 2016
-
-
Damien George authored
With this patch the n_args parameter is changed type from mp_uint_t to size_t.
-
- Dec 09, 2015
-
-
Damien George authored
-
- Nov 29, 2015
-
-
Damien George authored
This allows the mp_obj_t type to be configured to something other than a pointer-sized primitive type. This patch also includes additional changes to allow the code to compile when sizeof(mp_uint_t) != sizeof(void*), such as using size_t instead of mp_uint_t, and various casts.
-
Damien George authored
-
- Oct 18, 2015
-
-
Paul Sokolovsky authored
-
- Aug 13, 2015
-
-
blmorris authored
-
- May 12, 2015
-
-
Damien George authored
mp_obj_get_int_truncated will raise a TypeError if the argument is not an integral type. Use mp_obj_int_get_truncated only when you know the argument is a small or big int.
-
- Jan 28, 2015
-
-
Damien George authored
This cleans up vstr so that it's a pure "variable buffer", and the user can decide whether they need to add a terminating null byte. In most places where vstr is used, the vstr did not need to be null terminated and so this patch saves code size, a tiny bit of RAM, and makes vstr usage more efficient. When null termination is needed it must be done explicitly using vstr_null_terminate.
-
- Jan 23, 2015
-
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
After vstr refactor. Fixes #1084.
-
- Jan 21, 2015
-
-
Damien George authored
With this patch str/bytes construction is streamlined. Always use a vstr to build a str/bytes object. If the size is known beforehand then use vstr_init_len to allocate only required memory. Otherwise use vstr_init and the vstr will grow as needed. Then use mp_obj_new_str_from_vstr to create a str/bytes object using the vstr memory. Saves code ROM: 68 bytes on stmhal, 108 bytes on bare-arm, and 336 bytes on unix x64.
-
Damien George authored
This patch allows to reuse vstr memory when creating str/bytes object. This improves memory usage. Also saves code ROM: 128 bytes on stmhal, 92 bytes on bare-arm, and 88 bytes on unix x64.
-
- Jan 01, 2015
-
-
Damien George authored
Addresses issue #1022.
-
- Dec 05, 2014
-
-
Damien George authored
mp_obj_int_get_truncated is used as a "fast path" int accessor that doesn't check for overflow and returns the int truncated to the machine word size, ie mp_int_t. Use mp_obj_int_get_truncated to fix struct.pack when packing maximum word sized values. Addresses issues #779 and #998.
-
- Nov 16, 2014
-
-
Damien George authored
-
Paul Sokolovsky authored
Also, implement for unix port.
-
- Oct 24, 2014
-
-
Damien George authored
-
- Oct 23, 2014
-
-
Paul Sokolovsky authored
While extension to file.readinto() definition of CPython, the additional arg is similar to what in CPython available in socket.recv_into().
-
- Oct 18, 2014
-
-
Paul Sokolovsky authored
Also, usocket.readinto(). Known issue is that .readinto() should be available only for binary files, but micropython uses single method table for both binary and text files.
-
- Oct 17, 2014
-
-
Damien George authored
-
- Oct 16, 2014
-
-
Paul Sokolovsky authored
Just like they handled in other read*(). Note that behavior of readline() in case there's no data when it's called is underspecified in Python lib spec, implemented to behave as read() - return None.
-
- Oct 15, 2014
-
-
Paul Sokolovsky authored
This is CPython-compatible convention established yet in acb13886.
-
- Aug 22, 2014
-
-
Damien George authored
-
- Jul 27, 2014
-
-
Damien George authored
-
- Jul 22, 2014
-
-
Paul Sokolovsky authored
-
Paul Sokolovsky authored
-
Dave Hylands authored
With this fix, file_long_read now passes.
-
- Jul 19, 2014
-
-
Damien George authored
With unicode enabled, this patch allows reading a fixed number of characters from text-mode streams; eg file.read(5) will read 5 unicode chars, which can made of more than 5 bytes. For an ASCII stream (ie no chars > 127) it only needs to do 1 read. If there are lots of non-ASCII chars in a stream, then it needs multiple reads of the underlying object. Adds a new test for this case. Enables unicode support by default on unix and stmhal ports.
-
- Jul 13, 2014
-
-
Paul Sokolovsky authored
-
- Jul 03, 2014
-
-
Damien George authored
See discussion in issue #50.
-
- Jun 29, 2014
-
-
stijn authored
- rearrange/add definitions that were not there so it's easier to compare both - use MICROPY_PY_SYS_PLATFORM in main.c since it's available anyway - define EWOULDBLOCK, it is missing from ingw32
-
- Jun 26, 2014
-
-
Paul Sokolovsky authored
-
- Jun 13, 2014
-
-
Paul Sokolovsky authored
Getting a length of string may be expensive, depending on the underlying implementation.
-