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 7E4C8740034 for ; Tue, 12 Dec 2023 14:54:33 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=jAf3nKF26EVGQ14GlLBMfiS/Vjipa8Ox6G051QPkmOU=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1702392872; v=1; b=YG+qqWJk3SIMjNqqqOIcBaksJ9NhSroXJZvaludAihsC9akelzCgmknq2oE+ZrXry6sKXMfH LpLBfkMwx86UWmN3NAcW8aGhr1IC81+nZsqY71iJFQ5/CHPjKPXGQ+55JDG5AYG5NZuGQvSGXAw T9ylo/SyTypAyLiwQft9eSN4= X-Received: by 127.0.0.2 with SMTP id vbJ3YY7687511xrhivSvrDj4; Tue, 12 Dec 2023 06:54:32 -0800 X-Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) by mx.groups.io with SMTP id smtpd.web10.3582.1702392870436785729 for ; Tue, 12 Dec 2023 06:54:30 -0800 X-Received: by mail-lf1-f54.google.com with SMTP id 2adb3069b0e04-50bffb64178so6810385e87.2 for ; Tue, 12 Dec 2023 06:54:30 -0800 (PST) X-Gm-Message-State: ZIUAv0XmP3PQujeYDYlYOttqx7686176AA= X-Google-Smtp-Source: AGHT+IHQU44NGOThNxrQ419wh6rHRVm9Zz5YVFNc9VdKAlyYtC9JdjzwhEY1e5WFhMl2eEkxxDy1Sw== X-Received: by 2002:ac2:4e14:0:b0:50c:d6b:885e with SMTP id e20-20020ac24e14000000b0050c0d6b885emr3945837lfr.22.1702392868473; Tue, 12 Dec 2023 06:54:28 -0800 (PST) X-Received: from localhost.localdomain ([79.164.221.98]) by smtp.gmail.com with ESMTPSA id m21-20020a0565120a9500b0050d1d8674d2sm952008lfu.292.2023.12.12.06.54.27 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 12 Dec 2023 06:54:28 -0800 (PST) From: "Mike Maslenkin" To: devel@edk2.groups.io Cc: abner.chang@amd.com, nicklew@nvidia.com, igork@ami.com, Mike Maslenkin Subject: [edk2-devel] [PATCH 4/9] RedfishPkg: RedfishPlatformConfigDxe: reduce memory allocations Date: Tue, 12 Dec 2023 17:54:07 +0300 Message-Id: <20231212145412.50434-5-mike.maslenkin@gmail.com> In-Reply-To: <20231212145412.50434-1-mike.maslenkin@gmail.com> References: <20231212145412.50434-1-mike.maslenkin@gmail.com> MIME-Version: 1.0 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,mike.maslenkin@gmail.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: 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=YG+qqWJk; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.com (policy=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 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->Parent= Form->ParentFormset->HiiHandle, FullSchema, StatementRef->Statement->Descri= ption);=0D ASSERT (TmpString !=3D NULL);=0D if (TmpString !=3D NULL) {=0D - TmpConfigureLangList[Index] =3D AllocateCopyPool (StrSize (TmpSt= ring), TmpString);=0D - ASSERT (TmpConfigureLangList[Index] !=3D NULL);=0D - FreePool (TmpString);=0D + TmpConfigureLangList[Index] =3D TmpString;=0D ++Index;=0D }=0D }=0D --=20 2.32.0 (Apple Git-132) -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#112440): https://edk2.groups.io/g/devel/message/112440 Mute This Topic: https://groups.io/mt/103130782/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-