micropython/py
Damien George cf31d384f1 py/stream: Switch stream close operation from method to ioctl.
This patch moves the implementation of stream closure from a dedicated
method to the ioctl of the stream protocol, for each type that implements
closing.  The benefits of this are:

1. Rounds out the stream ioctl function, which already includes flush,
   seek and poll (among other things).

2. Makes calling mp_stream_close() on an object slightly more efficient
   because it now no longer needs to lookup the close method and call it,
   rather it just delegates straight to the ioctl function (if it exists).

3. Reduces code size and allows future types that implement the stream
   protocol to be smaller because they don't need a dedicated close method.

Code size reduction is around 200 bytes smaller for x86 archs and around
30 bytes smaller for the bare-metal archs.
2018-04-10 13:41:32 +10:00
..
argcheck.c
asmarm.c py/asm*.c: Remove unnecessary check for num_locals<0 in asm entry func. 2018-02-24 23:10:20 +11:00
asmarm.h
asmbase.c
asmbase.h
asmthumb.c py/asm*.c: Remove unnecessary check for num_locals<0 in asm entry func. 2018-02-24 23:10:20 +11:00
asmthumb.h
asmx64.c py/asm*.c: Remove unnecessary check for num_locals<0 in asm entry func. 2018-02-24 23:10:20 +11:00
asmx64.h
asmx86.c py/asm*.c: Remove unnecessary check for num_locals<0 in asm entry func. 2018-02-24 23:10:20 +11:00
asmx86.h py/asm*.c: Remove unnecessary check for num_locals<0 in asm entry func. 2018-02-24 23:10:20 +11:00
asmxtensa.c
asmxtensa.h
bc.c
bc.h
bc0.h
binary.c
binary.h
builtin.h
builtinevex.c
builtinhelp.c
builtinimport.c py/builtinimport: Add compile-time option to disable external imports. 2018-02-20 18:00:44 +11:00
compile.c py/compile: Adjust c_assign_atom_expr() to use return instead of goto. 2018-02-24 23:03:17 +11:00
compile.h
emit.h
emitbc.c py/emitglue: When assigning bytecode only pass bytecode len if needed. 2018-02-14 18:41:17 +11:00
emitcommon.c
emitglue.c py/emitglue: When assigning bytecode only pass bytecode len if needed. 2018-02-14 18:41:17 +11:00
emitglue.h py/emitglue: When assigning bytecode only pass bytecode len if needed. 2018-02-14 18:41:17 +11:00
emitinlinethumb.c
emitinlinextensa.c
emitnative.c
formatfloat.c py/formatfloat: Fix case where floats could render with negative digits. 2018-03-01 17:00:02 +11:00
formatfloat.h
frozenmod.c
frozenmod.h
gc.c py/gc: Update comment now that gc_drain_stack is called gc_mark_subtree. 2018-02-19 16:08:20 +11:00
gc.h
grammar.h
lexer.c
lexer.h
makeqstrdata.py
makeqstrdefs.py py/makeqstrdefs.py: Optimise by using compiled re's so it runs faster. 2018-03-16 23:54:06 +11:00
makeversionhdr.py py: Use "GEN" consistently for describing files generated in the build. 2018-02-22 12:48:51 +11:00
malloc.c py/malloc: Remove unneeded code checking m_malloc return value. 2017-12-20 16:55:42 +11:00
map.c py/map: Don't include ordered-dict mutating code when not needed. 2017-12-19 13:37:15 +11:00
misc.h py/misc.h: Remove unused count_lead_ones() inline function. 2018-03-13 13:23:30 +11:00
mkenv.mk
mkrules.mk py: Use "GEN" consistently for describing files generated in the build. 2018-02-22 12:48:51 +11:00
modarray.c
modbuiltins.c py/modbuiltins: Simplify and generalise dir() by probing qstrs. 2018-02-19 16:12:44 +11:00
modcmath.c
modcollections.c py/objdeque: Implement ucollections.deque type with fixed size. 2018-02-21 22:39:25 +11:00
modgc.c
modio.c py/modio: Use correct config macro to enable resource_stream function. 2017-12-19 16:59:08 +11:00
modmath.c
modmicropython.c py: Don't include mp_optimise_value or opt_level() if compiler disabled. 2018-04-04 14:24:03 +10:00
modstruct.c
modsys.c py/modsys: Don't compile getsizeof function if feature is disabled. 2018-04-04 14:23:25 +10:00
modthread.c
moduerrno.c
mpconfig.h py/objdeque: Implement ucollections.deque type with fixed size. 2018-02-21 22:39:25 +11:00
mperrno.h
mphal.h
mpprint.c
mpprint.h
mpstate.c
mpstate.h py: Don't include mp_optimise_value or opt_level() if compiler disabled. 2018-04-04 14:24:03 +10:00
mpthread.h
mpz.c py/mpz: In mpz_clone, remove unused check for NULL dig. 2018-02-25 22:59:19 +11:00
mpz.h py/mpz: Simplify handling of borrow and quo adjustment in mpn_div. 2017-12-29 14:05:48 +11:00
nativeglue.c
nlr.c py/nlr: Fix missing trailing characters in comments in nlr.c 2017-12-29 22:24:53 +11:00
nlr.h py/nlr: Fix nlr functions for 64bit ports built with gcc on Windows 2017-12-29 22:24:46 +11:00
nlrsetjmp.c py/nlr: Factor out common NLR code to macro and generic funcs in nlr.c. 2017-12-28 16:46:30 +11:00
nlrthumb.c py/nlrthumb: Do not mark nlr_push as not returning anything. 2018-02-18 01:35:27 +01:00
nlrx64.c py/nlr: Fix nlr functions for 64bit ports built with gcc on Windows 2017-12-29 22:24:46 +11:00
nlrx86.c py/nlr: Fix nlr functions for 64bit ports built with gcc on Windows 2017-12-29 22:24:46 +11:00
nlrxtensa.c py/nlr: Factor out common NLR code to macro and generic funcs in nlr.c. 2017-12-28 16:46:30 +11:00
obj.c
obj.h py/runtime: Check that keys in dicts passed as ** args are strings. 2018-03-30 11:13:32 +11:00
objarray.c
objarray.h
objattrtuple.c
objbool.c
objboundmeth.c py: Convert all uses of alloca() to use new scoped allocation API. 2017-12-11 13:49:09 +11:00
objcell.c
objclosure.c
objcomplex.c
objdeque.c py/objdeque: Use m_new0 when allocating items to avoid need to clear. 2018-02-21 23:36:46 +11:00
objdict.c py/objdict: Disallow possible modifications to fixed dicts. 2018-02-18 21:51:04 -06:00
objenumerate.c
objexcept.c py/objexcept: Make MP_DEFINE_EXCEPTION public so ports can define excs. 2018-03-17 00:31:40 +11:00
objexcept.h py/objexcept: Make MP_DEFINE_EXCEPTION public so ports can define excs. 2018-03-17 00:31:40 +11:00
objfilter.c
objfloat.c py/objfloat: Fix case of raising 0 to -infinity. 2018-02-08 14:35:43 +11:00
objfun.c py: Convert all uses of alloca() to use new scoped allocation API. 2017-12-11 13:49:09 +11:00
objfun.h
objgenerator.c py/objgenerator: Allow to pend an exception for next execution. 2017-12-15 20:20:36 +02:00
objgenerator.h
objgetitemiter.c
objint.c py/objint: Remove unreachable code checking for int type in format func. 2018-03-02 11:01:24 +11:00
objint.h
objint_longlong.c py/objint: Simplify LHS arg type checking in int binary op functions. 2018-04-05 01:11:26 +10:00
objint_mpz.c py/objint: Simplify LHS arg type checking in int binary op functions. 2018-04-05 01:11:26 +10:00
objlist.c
objlist.h py/obj.h: Move declaration of mp_obj_list_init to objlist.h. 2018-03-13 14:03:15 +11:00
objmap.c
objmodule.c py/objmodule: Factor common code for calling __init__ on builtin module. 2018-02-20 17:56:58 +11:00
objmodule.h py/objmodule: Factor common code for calling __init__ on builtin module. 2018-02-20 17:56:58 +11:00
objnamedtuple.c
objnamedtuple.h
objnone.c
objobject.c py/objtype: Refactor object's handling of __new__ to not create 2 objs. 2017-12-12 16:53:44 +11:00
objpolyiter.c
objproperty.c
objrange.c py/objrange: Implement (in)equality comparison between range objects. 2018-02-14 23:17:06 +11:00
objreversed.c
objset.c py/objset: Remove unneeded check from set_equal. 2017-12-19 14:01:19 +11:00
objsingleton.c
objslice.c
objstr.c py/objstr: In find/rfind, don't crash when end < start. 2018-04-05 16:14:17 +10:00
objstr.h
objstringio.c py/stream: Switch stream close operation from method to ioctl. 2018-04-10 13:41:32 +10:00
objstringio.h
objstrunicode.c py/unicode: Clean up utf8 funcs and provide non-utf8 inline versions. 2018-02-14 18:19:22 +11:00
objtuple.c
objtuple.h
objtype.c py/objtype: Check and prevent delete/store on a fixed locals map. 2018-02-07 15:44:29 +11:00
objtype.h py/objtype: Refactor object's handling of __new__ to not create 2 objs. 2017-12-12 16:53:44 +11:00
objzip.c
opmethods.c
parse.c py/parse: Fix macro evaluation by avoiding empty __VA_ARGS__. 2017-12-29 13:44:26 +11:00
parse.h
parsenum.c py/parsenum: Fix parsing of floats that are close to subnormal. 2018-02-08 14:02:50 +11:00
parsenum.h
parsenumbase.c
parsenumbase.h
persistentcode.c py/emitglue: When assigning bytecode only pass bytecode len if needed. 2018-02-14 18:41:17 +11:00
persistentcode.h
py.mk extmod/vfs_fat: Merge remaining vfs_fat_misc.c code into vfs_fat.c. 2018-02-23 17:24:57 +11:00
pystack.c py/pystack: Use "pystack exhausted" as error msg for out of pystack mem. 2018-02-19 00:26:14 +11:00
pystack.h
qstr.c
qstr.h py/qstr: Add QSTR_TOTAL() macro to get number of qstrs. 2018-02-19 16:12:44 +11:00
qstrdefs.h py/pystack: Use "pystack exhausted" as error msg for out of pystack mem. 2018-02-19 00:26:14 +11:00
reader.c
reader.h
repl.c py/repl: Generalise REPL autocomplete to use qstr probing. 2018-02-19 16:12:44 +11:00
repl.h
ringbuf.h
runtime.c py: Don't include mp_optimise_value or opt_level() if compiler disabled. 2018-04-04 14:24:03 +10:00
runtime.h
runtime0.h
runtime_utils.c
scheduler.c
scope.c
scope.h
sequence.c
showbc.c
smallint.c
smallint.h py: Extend nan-boxing config to have 47-bit small integers. 2017-12-11 22:39:12 +11:00
stackctrl.c
stackctrl.h
stream.c py/stream: Switch stream close operation from method to ioctl. 2018-04-10 13:41:32 +10:00
stream.h py/stream: Switch stream close operation from method to ioctl. 2018-04-10 13:41:32 +10:00
unicode.c py/unicode: Clean up utf8 funcs and provide non-utf8 inline versions. 2018-02-14 18:19:22 +11:00
unicode.h
vm.c py/vm: Optimise handling of stackless mode when pystack is enabled. 2018-04-04 00:51:10 +10:00
vmentrytable.h
vstr.c
warning.c