From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2116.outbound.protection.outlook.com [40.107.94.116]) by sourceware.org (Postfix) with ESMTPS id 355373858004 for ; Sun, 8 Nov 2020 13:12:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 355373858004 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BtiOGIFEQ6yBj7ZGhNJeMxLX7Qthy87VVj8XM7u9IE2KSTL2C9TGLHsePOrkwCLAUnlwE7DOF8InOe6WfKtjk+qlf1GBvDv6Jt2kxiYEOsOtXMnnt8CrQ+kazo62hXNPusglsbZT+jmxEPmrbTA3vNOaoMgWrArYHlLvWorqBcQyKZHQHaheTHxYSQQy8aIEdfM9ifc7i4Z0ETKwot+KyGEGPo+xbETOSk3tG7p/IywNQ8/lvidCBHtzPcgBHVBTqm6C7r/CY/w/KPmcPk5HVLnsqcSMJf4zwo0a8TyFV9lTZefKep0l/szt+tWjRxBcP0RNG5LlAU1C6JkAVl2zfA== 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=fuVqV6CZ0A2nhsI/Wrto1IPHaQqAij2/YQ1luQjBcJg=; b=EFwf9Kmsd+BoFWz+J/M/Jteo3jdCcnv4VaVGb0J8jGP5pPtJHkFyO2K3/ALAo5JZOUuLJynsWDXVFId1xGIr9x4a0YiuINYxIhG1DSuQBJ3LOgFCO/ySSe1nkM91m95tS1bb5EWpQCaQr9+k/+NYzJ6ihJ5lgD5W52+oxx0g5aLxDsalx9K5fiD37oQAPJmDChNiJNnzUhaxBpIA2Zwo1Sj+qmU4A18jtfNOgFe/Wg4NcBiJizJS2SJhPBXcR7iueH7G3dcE8MlpAd4F24WDxXQQiniqkqFiRzkybijZJiPqUry8okO7R2VNoXEyrwXzu7PqDh7qcQ5fk5ZFD+4Z0g== 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 MN2PR04MB5664.namprd04.prod.outlook.com (2603:10b6:208:a6::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3541.21; Sun, 8 Nov 2020 13:12:35 +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.024; Sun, 8 Nov 2020 13:12:35 +0000 Subject: Re: Size of fhandler_fifo To: cygwin-developers@cygwin.com References: <8814992e-ef08-31f5-3086-ad1caafff4de@cornell.edu> From: Ken Brown Message-ID: <390f7c91-456b-3481-3fe1-addc8a369909@cornell.edu> Date: Sun, 8 Nov 2020 08:11:51 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.4.1 In-Reply-To: <8814992e-ef08-31f5-3086-ad1caafff4de@cornell.edu> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [68.175.129.7] X-ClientProxiedBy: MN2PR14CA0030.namprd14.prod.outlook.com (2603:10b6:208:23e::35) To MN2PR04MB6176.namprd04.prod.outlook.com (2603:10b6:208:e3::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.0.17] (68.175.129.7) by MN2PR14CA0030.namprd14.prod.outlook.com (2603:10b6:208:23e::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3541.21 via Frontend Transport; Sun, 8 Nov 2020 13:12:34 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f127d944-8357-4389-7239-08d883e7f541 X-MS-TrafficTypeDiagnostic: MN2PR04MB5664: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: O5hBtnnkbRfquzUR6DtK8Gl1IJN1Rl7EZ9QHS7EKwp1QZLbUZYHn0pSbyHZlHXmfA0Qj6YIO7PKmR5dCLaGzDRQN3nk7ykmCQE/eVTGdTQCLaUM3aAP79jNLOczJqPNutjt9bdc+qkF2sKskr3r7aYVKkhzrEFZ1A9f+yHJ6CZzA/Hg5dVVnaNXNnrRVcN9GELGi53DPW5vOONBOnvSaM3iKZb5y6f6IBJwhaEpveafnDh09s9kplJ4vl2eeAyVNLmLbpyzwjnOJds1CCWIbeopj7LlZZ8m/psmoKvdRtW8Rid4fCFlMR0YDA50ThJPsUNNYMbRnzCKMZ0Y3feYRLnAQa0uoFtsL2rxQb8pVK7Jc8ebRpy4ghYFw4VGcAGkX 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)(396003)(366004)(376002)(39860400002)(346002)(66476007)(66556008)(26005)(6916009)(36756003)(2616005)(956004)(186003)(75432002)(86362001)(52116002)(53546011)(16526019)(8676002)(478600001)(8936002)(31686004)(16576012)(7116003)(2906002)(5660300002)(786003)(31696002)(6486002)(316002)(66946007)(6666004)(43740500002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: yh9yMerlYoeqozhXYj2kN6SaC6aNG0XOCSfqraImT55da/mU3U7e2e223qOF1jxVFkvTmCQoIl40+/s96ckgE/IiEcuY5YlYzfNAUJjbVvAg2ce7TrlhYdz5obIY4fpc9f8Vp/Fsqu0u0TOBG5jg6U7jUxCZuZo7qcqLDGopscJrwPBITP/6OlXPSHBrB8czHh2I8C24C4gOpeDs2TFJfGlL/jwvXuPvaIw4J1P5k4LO/fnU56hwoBmwUjat1mGgZiUYYfFUCkT6w+tBluAgtb+Po/Bq13xUZsATrkDGLM4PhNl6depzoZ3W45EF1eK97uCREH1A3clyTSe5oX0Navv4js2lA1mx8OEi3PF+H+S30K0Tjea4koZdM/jh0r5sxkjJYsQNrQ2KVir/mTRZumFKNBRfLy8JcSZ0L/Gox793sdciLLtP9QBbd2x43x5hGNvW1NPh4KQIRspQ37yju4382rKsWUhh3k0ygzLdReHCumvWZVY/UQd3eGB1oRUojZ8s9z09tnehCy7hR8D/9773zEfI19Rb3RnsMc5kpzAkVfe+PEsmoPIHaun4Mi2w0DVs4ej1tdtLutWoN9jySzq3tNmzwykbHDJ5IPedUl6wulkuZidBKQEAeci5PAd4JB1KZAiTZFi4vCC7cnTbPg== X-OriginatorOrg: cornell.edu X-MS-Exchange-CrossTenant-Network-Message-Id: f127d944-8357-4389-7239-08d883e7f541 X-MS-Exchange-CrossTenant-AuthSource: MN2PR04MB6176.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Nov 2020 13:12:35.5152 (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: 9xmwAInAX3rDiGHs7KlKb+nIljC0AIgBjTHqjWDFaO0qP8Q+8DRfQKlBebxeBzhnTeFikyhf2ISV45j2P3W0fw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR04MB5664 X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_00, DKIM_INVALID, DKIM_SIGNED, KAM_DMARC_STATUS, MSGID_FROM_MTA_HEADER, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no 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: Sun, 08 Nov 2020 13:12:40 -0000 On 11/7/2020 10:19 AM, Ken Brown via Cygwin-developers wrote: > 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. These details probably aren't so bad. I'll code this and see what it looks like Ken