From nobody Tue Feb 10 02:49:52 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+112863+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+112863+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1703458777; cv=none; d=zohomail.com; s=zohoarc; b=dZWYmABNDfgM/Z2j/3QyAt1HgTNn67iIV020jRdr44h8yqj9N9KmmU5Fa3QtKyJEO6pi7cE0hR8fEJueCxUnkksKGiU3FEaG4zOxg85kTbvTb9WGbN1zk68fCXIsbqCS7ckX1+/t70Rpjf8+OLVfQUkO6emhf7KoREs4ZJmAI4g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1703458777; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=umDJhNaIE9mZE8rWKnT4//xVZgvX0dIJYmTzaQUIJuc=; b=ZmSQWtWcS+G75y2B0zSEueZ9qyyUVuhpNYUimJpIHEi1tCsL28QWLk1OlPJEHdxAiTAZyrrxdTaTTPJa3cCp86st2vzDYbOaD3pNFDvzQkKpnndoSoELR6QfRKjNPIDAanuU1KUmXvJnai4wgfgwqlQyxAoA/7sSU34rO+tVUTI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+112863+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1703458777422477.92484902705974; Sun, 24 Dec 2023 14:59:37 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=usnDJ/xhT+/EOOUDahW1d1RnP/cSXS8cGofbNfOytJQ=; 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=1703458777; v=1; b=lJAzsfiy+pL9TLFymahJTAyA6jXPz7h7driU+/SHmr5pfQYAeHhNYlqotwSMgtA02jlbGMdf tBEylnlokAJf6XTrnydTTMristwHPOUgrN2Rrkwf7UhkTvg9KumpSLcRK15EeSibSYGXNWmSvZb mBtgTDe3E+Ei+b0IkhWjhlps= X-Received: by 127.0.0.2 with SMTP id V3I4YY1788612xbQ7YjqNASD; Sun, 24 Dec 2023 14:59:37 -0800 X-Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) by mx.groups.io with SMTP id smtpd.web10.35942.1703458776129724345 for ; Sun, 24 Dec 2023 14:59:36 -0800 X-Received: by mail-lf1-f50.google.com with SMTP id 2adb3069b0e04-50e68e93be1so2103138e87.0 for ; Sun, 24 Dec 2023 14:59:35 -0800 (PST) X-Gm-Message-State: q7uyMvoDar7J0nuzIbd5ZiLBx1787277AA= X-Google-Smtp-Source: AGHT+IHqUozZz2IXgxZIh5aV0Ol1qj0E9EANUeLk1AqDTD6MWjq4v1M2sNhOfcpPqRVSbtBWm0FL5w== X-Received: by 2002:a05:6512:208e:b0:50e:7b47:97d with SMTP id t14-20020a056512208e00b0050e7b47097dmr144592lfr.112.1703458774265; Sun, 24 Dec 2023 14:59:34 -0800 (PST) X-Received: from localhost.localdomain ([79.164.221.98]) by smtp.gmail.com with ESMTPSA id be44-20020a056512252c00b0050e78f5178asm326596lfb.262.2023.12.24.14.59.33 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 24 Dec 2023 14:59:33 -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 v3 04/16] RedfishPkg: RedfishPlatformConfigDxe: reduce memory allocations Date: Mon, 25 Dec 2023 01:59:15 +0300 Message-Id: <20231224225927.9119-5-mike.maslenkin@gmail.com> In-Reply-To: <20231224225927.9119-1-mike.maslenkin@gmail.com> References: <20231224225927.9119-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-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1703458778392100013 Content-Type: text/plain; charset="utf-8" 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: Nickle Wang Cc: Igor Kulchytskyy Signed-off-by: Mike Maslenkin Reviewed-by: Abner Chang --- .../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); ASSERT (TmpString !=3D NULL); if (TmpString !=3D NULL) { - TmpConfigureLangList[Index] =3D AllocateCopyPool (StrSize (TmpSt= ring), TmpString); - ASSERT (TmpConfigureLangList[Index] !=3D NULL); - FreePool (TmpString); + TmpConfigureLangList[Index] =3D TmpString; ++Index; } } --=20 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 (#112863): https://edk2.groups.io/g/devel/message/112863 Mute This Topic: https://groups.io/mt/103354123/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-