diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2020-04-25 10:43:42 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2020-04-25 10:43:42 -0700 |
commit | 1de059d0f51cd3aa003a9e0d1de4662a5f758c37 (patch) | |
tree | b888683dd7327f5a2f3afd5b5f14b6ad46ea1fca /tl.vim | |
parent | 0b52768a15706b53e38890e1dc1ebc7f92e00166 (diff) | |
download | txr-1de059d0f51cd3aa003a9e0d1de4662a5f758c37.tar.gz txr-1de059d0f51cd3aa003a9e0d1de4662a5f758c37.tar.bz2 txr-1de059d0f51cd3aa003a9e0d1de4662a5f758c37.zip |
Reduce footprint of :fd property.
Querying the :fd stream property is equivalent to calling the
stream-fd function. Streams have a C virtual function get_fd,
so implementing :fd in their getprop functions is redundant
functionality. The stream-getprop function can test for
:fd and call stream-fd, so the stream implementations don't
have to deal with the :fd property.
Also, there are still places in the code base that are using
stream_getprop to get the file descriptor, instead of calling
stream_fd.
If we fix all this, then fd_k remains referenced only in
a very small number of places.
* socket.c (dgram_get_prop): Don't handle :fd any more.
* stream.c (unimpl_get_fd): Static function removed.
(fill_stream_ops): Default the get_fd function to null_get_fd
instead of unimpl_get_fd, so it doesn't throw.
Even a stdio stream don't throw; when the file is closed,
it returns nil.
(stdio_get_prop): Don't handle :fd any more.
(stream_get_prop): Handle :fd here. If the stream has a get_fd
function that isn't null_get_fd, then call it. Only if the
stream doesn't have a get_fd function, fall back on its
get_prop function.
* sysif.c (mkdir_wrap, poll_wrap, simulate_setuid_setgid):
Call stream_fd instead of stream_get_prop.
Diffstat (limited to 'tl.vim')
0 files changed, 0 insertions, 0 deletions