From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id B294C740032 for ; Mon, 18 Dec 2023 02:44:42 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=k4bXZVubSSUlgL41a3LVpLmcxrMYquQajcQfOJV8zZU=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:msip_labels:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1702867481; v=1; b=KSxPS5yMCrbOeAMs0t392Sv1GbjKs8WEezSGdmMK8XIWaEd3tWhAyO++Rvk+85DO51xvXS5Y dz4mvGD2BVnoV6+TYt1kp9K4OYljjPJPUHBqiW7/v3nTUk+BdwrSReUnVuupYLgUdLdYLguAV1D WJmk7uqjutWeeGoXLPNtcFsM= X-Received: by 127.0.0.2 with SMTP id i5KAYY7687511xhKe2BzvlQ4; Sun, 17 Dec 2023 18:44:41 -0800 X-Received: from NAM12-BN8-obe.outbound.protection.outlook.com (NAM12-BN8-obe.outbound.protection.outlook.com [40.107.237.76]) by mx.groups.io with SMTP id smtpd.web11.34243.1702867480330799885 for ; Sun, 17 Dec 2023 18:44:40 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IFwn6FfX+Tu9pTr6T2qf1pcpbUuSoKhhcHOQCdGyX5RBV0kbJFPwpjRTgDqBLo/D2txG4L4j6NcStq7Vd6014bCBogIIIdulUCyYJsItv9O+bElphXc1B+OPdWBpV8CzEwXGyEt9vseuR+dlxaakqcLD42Rn9lGfrtrlGm2NEL9LXkwpUOCNyRzUTVoRjnZaPh6ymrKXneBvoMxLvGoXafPkKFzIgtl1lUcEK4knByC9HiWQC+WgkJVySW7h234EX9jIYSg2PRsicIm/dpVtRHoKF6NXBSnVKt0+KBgHBMlWDq56Qu2qVJDrC46f11aBcbMUrx7iiMcPN9KnGweWeA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=sTBWBN+ZUiy+/XFru8aebVR9apHn+a6n/tVq9y6nKAQ=; b=WDZcj68FYeiOdc01AkpxPMRPQNNCeDH7klYC4QABcg7vpvuY4XSbio44INIhtR3RlCQ+ClMB1MFDXRLCmu01a6s8UyB+k89edjBlbFEO/3biWCN2tiYTRJZ1zPgCEAvk5dxYIkqQwf1sIu1qZCzWoQOh+CAcPNidDfS+kKQVHykq07pGeWYgC9IbUvZjd860V/RpDenkqJ7BPOq8pjwop1tXF+XoNearHqzGwradjjucJp5vP73BLaE79KEwcODN5d2g8SlhQHRdgiPDFwlc2f1SSNl35oEm4niZNgChwRhQyDPIuEGjCecvQrm4gFwyU7TyjObytXV0HDgIBAZfRw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none X-Received: from MN2PR12MB3966.namprd12.prod.outlook.com (2603:10b6:208:165::18) by DS7PR12MB6071.namprd12.prod.outlook.com (2603:10b6:8:9d::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.37; Mon, 18 Dec 2023 02:44:34 +0000 X-Received: from MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::91d9:e679:32a3:dd05]) by MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::91d9:e679:32a3:dd05%5]) with mapi id 15.20.7091.034; Mon, 18 Dec 2023 02:44:34 +0000 From: "Chang, Abner via groups.io" To: Mike Maslenkin , "devel@edk2.groups.io" CC: "nicklew@nvidia.com" , "igork@ami.com" Subject: Re: [edk2-devel] [PATCH v2 04/14] RedfishPkg: RedfishPlatformConfigDxe: reduce memory allocations Thread-Topic: [PATCH v2 04/14] RedfishPkg: RedfishPlatformConfigDxe: reduce memory allocations Thread-Index: AQHaLuTGkGaOP606iES5Q2u3IhWbp7CuWlYQ Date: Mon, 18 Dec 2023 02:44:34 +0000 Message-ID: References: <20231214232458.4636-1-mike.maslenkin@gmail.com> <20231214232458.4636-5-mike.maslenkin@gmail.com> In-Reply-To: <20231214232458.4636-5-mike.maslenkin@gmail.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_d4243a53-6221-4f75-8154-e4b33a5707a1_ActionId=c6baed72-e8da-4760-b590-74b5b7c167d0;MSIP_Label_d4243a53-6221-4f75-8154-e4b33a5707a1_ContentBits=0;MSIP_Label_d4243a53-6221-4f75-8154-e4b33a5707a1_Enabled=true;MSIP_Label_d4243a53-6221-4f75-8154-e4b33a5707a1_Method=Privileged;MSIP_Label_d4243a53-6221-4f75-8154-e4b33a5707a1_Name=Public-AIP 2.0;MSIP_Label_d4243a53-6221-4f75-8154-e4b33a5707a1_SetDate=2023-12-18T02:44:25Z;MSIP_Label_d4243a53-6221-4f75-8154-e4b33a5707a1_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN2PR12MB3966:EE_|DS7PR12MB6071:EE_ x-ms-office365-filtering-correlation-id: 5b3cfbc0-ec5e-4a36-6d60-08dbff7344bb x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: lTEMzeHOkpRI+UQC9W1Kb425Mzq1DJ+ldQK+eS2mKqjvOjhTbITaPQW7jEVLhkhhc5bbnRI2hzcyX/cIlGAq5oJ5XgruRypWn8ntA4yIK0jAJhVDYroOiMeqiIPI1d9+WlP0Qh2ECK86BPWkC7fwdTD6zYr4tJU5Di6fouHtiYk8i288/4Y5FeNG6XuboPsGWOhAVM0aEVm5q/XdXO0086LNdwT+v5cRAJiCfsoB2cvKnX1nz+2zWu/ARH/cA2GbFHoTnk54HVNM3+Kvmy2VpWOC3H504ZLno+k6xf+Jt4fmG9wclIGepueA5qr8GXRBtEag7h5ZWJzby3sMJYOrmRfXkUIvLD3jILyF722EMWRMsbxB9QZaRYPBkA/7TiveAlEH48nsEJheVwhS8PcAOAkDfVFr1l+pZQ9KnNMccme8CAnYCaHgpZRyu7isE2rseL/phquamPuTzr9t3kqKgphP+8CiU16L/aX/A61af/yZjfAo14RgK06qQTGdTUpSdccVODjAX3dK/vn3Ew06tjBwExP9ms35PKrx97FiX8YrDiUjrJjwMJrkStTpi7m/a/In0pYXRUEj6tf1UDkdQCkiUnhAOnZBOWHdrgUyNcfubQAm9UCVcLpF2svuWGIOT3Xb5a4O83N8b/+DG85Dzq4U7P0GkTpyXrNmxzAk5CU= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?jFETP+wmC+CtzAWU29SuP0IUvnvYAvKGfw3+Oh2iIGWe+ZRF3RbymWN+1hPa?= =?us-ascii?Q?LRvKfv2hCPsidObUyMXxx3U1VVpdFLgh5K6WIezv6rdUEfOrQiOR5PtYdjBC?= =?us-ascii?Q?IVz5R9NumayfmiDblbVAPCWsI8jJNw/v+n7c2e4+dPeCRKl7FAtxLIpWu1xW?= =?us-ascii?Q?sW67hEskm/YnBOtY6AzyVZ1q3VK+6CradFoUXBs1jDaBrIB9qbFQM+OyBJ37?= =?us-ascii?Q?NGeeNQ7U89sPL34523PJVHoo8uEWLamn2X0N57roI6WP//oOi+XGufg0/O8f?= =?us-ascii?Q?8YI4hwkRUdwP5OjOGIDZo7wG3yVPiJ5GEkSWjP+r2v6dIX3hBHVrTJ6anOva?= =?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RdHcaorxBYXbesbmCy2NH6hjiqb?= =?us-ascii?Q?RCBfslmZj8xaWjGEQy5KBKC0L/svIUZWjZHJ4t1Ln9a1ilVlyzP082zEkkhe?= =?us-ascii?Q?HAXYAtPHO79M9GBAGsLfq9pU5v3zDYGQZbJNqHmnZlhzlBmmuJK8CFVp+k8W?= =?us-ascii?Q?kAUwXW/Z0QO7fnOa0GMJ3+Gms4S13pchRC8FqKatQpBZwcWFeS8wHfS+Xd47?= =?us-ascii?Q?e7IeaT7y27N89wCjFuFOzSKeVd1XMDC++/HcWzqlagozSSIZdWR0TwTTmd0Y?= =?us-ascii?Q?JYwIAIZ2UHUPifwF4oi4u/kPrVJNCxDmiHrQiKFUDy7A6NKzZp7cOvnDmcaU?= =?us-ascii?Q?5+P8AeauztNqDN0O9b0=3D?= MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB3966.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5b3cfbc0-ec5e-4a36-6d60-08dbff7344bb X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Dec 2023 02:44:34.2044 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: B41XGCjLXncvwlekFikVZBWQe1s3ixIiVZFQjNtA422aSGv+g8Nj/lngJWL0f9sMYLM2TWdrV0jcb2jhHDvVIg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB6071 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,abner.chang@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: gPOiqMUAO6sHmCO6WRxNG8Ebx7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=KSxPS5yM; dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}") [Public] Reviewed-by: Abner Chang > -----Original Message----- > From: Mike Maslenkin > Sent: Friday, December 15, 2023 7:25 AM > To: devel@edk2.groups.io > Cc: Chang, Abner ; nicklew@nvidia.com; > igork@ami.com; Mike Maslenkin > Subject: [PATCH v2 04/14] RedfishPkg: RedfishPlatformConfigDxe: reduce > memory allocations > > Caution: This message originated from an External Source. Use proper caut= ion > when opening attachments, clicking links, or responding. > > > It's unclear why the new string is allocated as copy of the original > string if its pointer is stored in an array and the original string > is released immediately after the copy is created. All data allocated > in the same pool. > > Cc: Abner Chang > Cc: Nickle Wang > Cc: Igor Kulchytskyy > Signed-off-by: Mike Maslenkin > --- > .../RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe= .c > b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c > index cbc65ba59408..f970e317b3f6 100644 > --- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c > +++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c > @@ -2057,9 +2057,7 @@ RedfishPlatformConfigProtocolGetConfigureLang ( > TmpString =3D HiiGetRedfishString (StatementRef->Statement- > >ParentForm->ParentFormset->HiiHandle, FullSchema, StatementRef- > >Statement->Description); > > ASSERT (TmpString !=3D NULL); > > if (TmpString !=3D NULL) { > > - TmpConfigureLangList[Index] =3D AllocateCopyPool (StrSize (Tmp= String), > TmpString); > > - ASSERT (TmpConfigureLangList[Index] !=3D NULL); > > - FreePool (TmpString); > > + TmpConfigureLangList[Index] =3D TmpString; > > ++Index; > > } > > } > > -- > 2.32.0 (Apple Git-132) -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#112620): https://edk2.groups.io/g/devel/message/112620 Mute This Topic: https://groups.io/mt/103181039/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-