From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2127.outbound.protection.outlook.com [40.107.220.127]) by sourceware.org (Postfix) with ESMTPS id 949FF386EC5D for ; Sat, 7 Nov 2020 15:19:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 949FF386EC5D ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ln+ko2a/rQN/hV0EMvdscGrs5qIPYDrX7Mvu8OvC5cC29Gqt6qOPBZXTV08pCh8yNFQx76yN/kS+pGP2YFtKhMM/CKjMO94u0GZXVdPVLxMsTaRVnocMTmRWFNe3fxd88w6H2o28OjDWLM9VYn7txOCP2N7UqRYx/ESiXcTWIBD7OVi5o0GsWxyTYGLBKcwjN0XHhZtBNG1tL2rhbpu3deKNaOU92VA6pxWlj79OvtXdsOOGh1uWTTqzMX0Lw89Wn6xYWuqvlQUzb+fZlZoeU76LrKHQMqSzQ3+u1an6OZS0JMBIP21tVCOIO4H1vMVVSqY+Z/arUqjDhCFIfY+5pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nhqQGOi3LaXsM6duubw8evk6H6rZsD6J/qIC95NcazY=; b=IpyfZd1k2EzTmKYkFU1St6niDJpcFoO44PHwdBhylEXmizWGRvPdr2RmyDVANLp19hR4/dOcSTbh1ni8rBcXdPHr2W0d+ADKdh9hENWwQxVbhgHUwWIaPF37tzEitTFJDTGXxQHw4WAt7hrc7u3Y3jfpA1Qt41fvmcNiB939v28chfUNkQ48Fdd8crzIfLRrGNkmmXyIzQOD6h4Jgm5/+S2MD7WayRetlTEExnqGruRnQsiw5zzRInpQuH00myDph2gJuySHP5nfjVrWIAH2u/mk/WwL4nNGKKQjLMPLuigsH7wlQ033+XgaDZfb4VNlmWwFzImHuTPqSPoski1v+A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cornell.edu; dmarc=pass action=none header.from=cornell.edu; dkim=pass header.d=cornell.edu; arc=none Received: from MN2PR04MB6176.namprd04.prod.outlook.com (2603:10b6:208:e3::13) by MN2PR04MB6222.namprd04.prod.outlook.com (2603:10b6:208:d8::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3477.25; Sat, 7 Nov 2020 15:19:52 +0000 Received: from MN2PR04MB6176.namprd04.prod.outlook.com ([fe80::113e:c874:1207:eca8]) by MN2PR04MB6176.namprd04.prod.outlook.com ([fe80::113e:c874:1207:eca8%6]) with mapi id 15.20.3541.021; Sat, 7 Nov 2020 15:19:52 +0000 To: cygwin-devel From: Ken Brown Subject: Size of fhandler_fifo Message-ID: <8814992e-ef08-31f5-3086-ad1caafff4de@cornell.edu> Date: Sat, 7 Nov 2020 10:19:51 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [2604:6000:b407:7f00:1cee:fd0c:2b36:c1c3] X-ClientProxiedBy: MN2PR12CA0010.namprd12.prod.outlook.com (2603:10b6:208:a8::23) To MN2PR04MB6176.namprd04.prod.outlook.com (2603:10b6:208:e3::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [IPv6:2604:6000:b407:7f00:1cee:fd0c:2b36:c1c3] (2604:6000:b407:7f00:1cee:fd0c:2b36:c1c3) by MN2PR12CA0010.namprd12.prod.outlook.com (2603:10b6:208:a8::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3541.21 via Frontend Transport; Sat, 7 Nov 2020 15:19:52 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 652a983f-d8e3-4ba9-35e0-08d883309319 X-MS-TrafficTypeDiagnostic: MN2PR04MB6222: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Mwq7vCMv4t8bpR3IOY7a8vFpd0r2sV4Zi7/6i/S+vmoQkg2IxjXm9dOL6FblRUD2HsaxbolP0BIRl+uPsKWcj6DBG4U1X8D3hOdKGPAiPKLxrta+yljBb2F/iq16HXtNSOAYCMISWnXFccLRSumuAyOmdu5b8BfuCniQ7fp2mV3AZLCn2xll2bJtV+dBiRdaVj0rkpaqmNBpCRV8iq5Ht5XMFl5nvlDG+LfvgQhWx6FaskM8AD5Uv82J1dcE4pnjsY4KOJPKYIxIamBakceA+yKRn/eOK+90wneDAXvkWY4XOsy5GRdSWFODuJb5DnEL40P6P+vSEDbLf8xSsnLdbIWNH+dKfXbTAZ1xCbL3e/7h4RP3m+uQSN6aZGaA6Ybg X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR04MB6176.namprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(376002)(39860400002)(366004)(396003)(346002)(2616005)(16526019)(478600001)(36756003)(8936002)(2906002)(6916009)(8676002)(31696002)(6486002)(31686004)(86362001)(52116002)(5660300002)(316002)(66556008)(7116003)(66476007)(786003)(186003)(66946007)(75432002)(43740500002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: QJUsShmL02SgLt435hQcvYdgIocYBzlZZk7PblAzKYoV0AvvxmH/g1Z4pYmq5zw0Ht6IuiYKkjCC2TqxCrd2bjClDfZyJg2/OYgXzpW6iv9crugFEubj8yuGFGSrH4A0jMi7f02FcE3OAM6f1V68uA6MfrPne4ACTmgc1pTFWdE/wQKYuNHIDfFX01m/6JhO7CVUP0iPF4B9u/sxmPqvMYQY6RqQA1cGJGYBFR+qmQrTe0GjEuatf5T5BPwUw5BXI89lFWhnstsoYPm9XHyqYMDdB2EFgc28ElSwom0y2IQWvSxCNJKNPiDU851VzLBBbOySpl9bYcuMVSNp/jFZzEbTSPFSia/bnBPWYNV4Jfty+V+xrDU+g8Oa0VYupR7ho0A3nD8jxUU9DlwDybYDQE5YC+VgO93aApr28JPPwvNYewdvxJvKHtIhGVygf0bsbA/gTyJP+Yr7y6wMcv9VcpGUCkPxRSvSOeBULp/OBjXfv4TXnuci3jvx4flOU37eq1zShZQEzCRV1AhzLVxI8RWShk9gOe661gfKuj/I3IJ1wRxGPi+ViUSBvAduMDhSDLx16S48OxH5OZp6LGzeDW/6QUYTkVmc5JI9hZtEiQSfTsF5kw9y19MplQff4SxHxfkyLe7bafrFUaXFoPxKP/oUINYiabbyLJz+mv40EUM/wi9QFOzrzEc4bTrD0+P+keIRg1wtYij2XHywhE/8sw== X-OriginatorOrg: cornell.edu X-MS-Exchange-CrossTenant-Network-Message-Id: 652a983f-d8e3-4ba9-35e0-08d883309319 X-MS-Exchange-CrossTenant-AuthSource: MN2PR04MB6176.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2020 15:19:52.3546 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 5d7e4366-1b9b-45cf-8e79-b14b27df46e1 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: EXuC6VqN/r05cus2wTlG7SfTDit5OUTX742hXnv9m/qtv1L8dCTNZTmZxRAZ6VYBicBpVS35LVbJd6A4y40eUg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR04MB6222 X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: cygwin-developers@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component developers mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Nov 2020 15:19:56 -0000 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