micropython/ports/unix
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
..
coverage-frzmpy
coverage-frzstr
modules
.gitignore
Makefile unix/Makefile,embedding/Makefile: Remove obsolete use of STMHAL_SRC_C. 2018-02-14 15:24:21 +11:00
alloc.c
coverage.c unix/coverage: Allow coverage tests to pass with debugging disabled. 2018-03-08 12:49:31 +11:00
fatfs_port.c
fdfile.h
file.c py/stream: Switch stream close operation from method to ioctl. 2018-04-10 13:41:32 +10:00
gccollect.c
input.c
input.h
main.c unix: Add support for using the Python stack. 2017-12-11 13:49:09 +11:00
modffi.c py/objstr: Remove "make_qstr_if_not_already" arg from mp_obj_new_str. 2017-11-16 13:17:51 +11:00
modjni.c py/objstr: Remove "make_qstr_if_not_already" arg from mp_obj_new_str. 2017-11-16 13:17:51 +11:00
modmachine.c
modos.c py/objstr: Remove "make_qstr_if_not_already" arg from mp_obj_new_str. 2017-11-16 13:17:51 +11:00
modtermios.c
modtime.c
moduos_vfs.c
moduselect.c
modusocket.c py/stream: Switch stream close operation from method to ioctl. 2018-04-10 13:41:32 +10:00
mpconfigport.h ports: Enable ucollections.deque on relevant ports. 2018-02-21 22:55:13 +11:00
mpconfigport.mk
mpconfigport_coverage.h unix/mpconfigport_coverage: Enable range (in)equality comparison. 2018-02-14 23:22:02 +11:00
mpconfigport_fast.h
mpconfigport_freedos.h
mpconfigport_minimal.h
mpconfigport_nanbox.h
mphalport.h
mpthreadport.c unix: Add support for using the Python stack. 2017-12-11 13:49:09 +11:00
mpthreadport.h
qstrdefsport.h
unix_mphal.c