public inbox for cygwin-developers@cygwin.com
 help / color / mirror / Atom feed
From: Ken Brown <kbrown@cornell.edu>
To: cygwin-devel <cygwin-developers@cygwin.com>
Subject: Size of fhandler_fifo
Date: Sat, 7 Nov 2020 10:19:51 -0500	[thread overview]
Message-ID: <8814992e-ef08-31f5-3086-ad1caafff4de@cornell.edu> (raw)

Hi Corinna,

This is a followup to your question on IRC about why fhandler_fifo is so big. 
The main reason is the pipe_name_buf member, which occupies 96 bytes and stores 
the Windows named pipe name.

There's a similar need to store the pipe name for the fhandler_socket_unix 
class.  In that case you used pc.{set,get}_nt_native_path.  But the latter is 
already in use in the fhandler_fifo case, so I can't use that.  I see several 
possible ways to proceed:

0. Do nothing and live with fhandler_fifo being big (736 bytes on 64-bit).

1. Don't store the pipe name; just regenerate it whenever it's needed.

2. Add members to path_conv to handle pipe names, analogous to wide_path and 
uni_path.  This increases the size of path_conv from 336 to 360 on 64-bit (one 
pointer and one UNICODE_STRING).

3. Imitate in fhandler_fifo what's done in path_conv.  So we would replace 
'WCHAR pipe_name_buf[48]' by 'PWCHAR pipe_name_buf' and then malloc space for 
the pipe name.

These all have disadvantages.

#2 increases the size of path_conv for the sake of one class (although 
fhandler_socket_unix could use it too).  #3 requires fhandler_fifo to deal with 
a lot of malloc/free/strdup details that are normally handled by path_conv and 
are hidden from fhandler classes.

Ken

             reply	other threads:[~2020-11-07 15:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-07 15:19 Ken Brown [this message]
2020-11-08 13:11 ` Ken Brown
2020-11-09  9:15 ` Corinna Vinschen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8814992e-ef08-31f5-3086-ad1caafff4de@cornell.edu \
    --to=kbrown@cornell.edu \
    --cc=cygwin-developers@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).