| Message ID | 20251210000737.180797-15-sjg@u-boot.org |
|---|---|
| State | New |
| Headers |
Return-Path: <concept-bounces+u-boot-concept=u-boot.org@u-boot.org> X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765325347; bh=vFNkxXa04aA8g15IyPvqCCS9kwkD/TuEBvLMTST+9SA=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=jZyNh0NP39fUyJ6UCbIIzL6Jj0OwlAuqktT24C6hei/KQ4g087d+BMMB08Ocf7yUg +TA6ZFctXHsubTumKD7X+A/8QPObWupH8BLxlxU5Mo9oYYww4sBF8FRd0nb6A7npUm AcHFYNIQ7jT9te2rNOBAD4gd961DDcRw7GNObrgNUZkuo6qnbllXjcoAdgOJ1n3FYC kExFowp5NDrcqoWHWJUxsVxaTaAv664lrp7HuwfLpPP6eyNRvfx7VYBvgv2MxEV+MZ r+ioMDRjEEoH+xChzt9XzE439oH5FC/ZRTka+iMRfRanAez+jItHeIUVrsrYnkQrOV PdTlT5OvvzizA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6C63068A22 for <u-boot-concept@u-boot.org>; Tue, 9 Dec 2025 17:09:07 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id OQm1vf5BdYxJ for <u-boot-concept@u-boot.org>; Tue, 9 Dec 2025 17:09:07 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765325347; bh=vFNkxXa04aA8g15IyPvqCCS9kwkD/TuEBvLMTST+9SA=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=jZyNh0NP39fUyJ6UCbIIzL6Jj0OwlAuqktT24C6hei/KQ4g087d+BMMB08Ocf7yUg +TA6ZFctXHsubTumKD7X+A/8QPObWupH8BLxlxU5Mo9oYYww4sBF8FRd0nb6A7npUm AcHFYNIQ7jT9te2rNOBAD4gd961DDcRw7GNObrgNUZkuo6qnbllXjcoAdgOJ1n3FYC kExFowp5NDrcqoWHWJUxsVxaTaAv664lrp7HuwfLpPP6eyNRvfx7VYBvgv2MxEV+MZ r+ioMDRjEEoH+xChzt9XzE439oH5FC/ZRTka+iMRfRanAez+jItHeIUVrsrYnkQrOV PdTlT5OvvzizA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5BE0F68974 for <u-boot-concept@u-boot.org>; Tue, 9 Dec 2025 17:09:07 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765325346; bh=yBA6tS74TUgno+qDEs1+TKmgy1qVo/UioN1kAoWRZzA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c+PRd+iCFuejVGkpfe7Oc10PZTdGx71+74UH9C14+bU9szu29xvQqtjGLnCTJSbMR Ck294jV1wGI7gBQM7crVs6GDMs7gLQVSAb0b0NNT/AiC+zwfjWEX0Fh/zn+HR9J9sg Ljv9Q8XJe9NeMWUfi39nlClrJxVQT0MDL6EDLoe4y68hmZ94PBRkbzcm+lUYqqyilX ZrxsD/lWJOOO5cgxTFMduSbn/qZqS/1UKTAdkzVd5uptupSVtXwxtawB18xRs5Kn9P /xTGYbZiu6ADb5EN7Cw27YvGbd1MIKhuekm9x6mBqUutQBagLYkM2Xua7nltM6TeRb AKNi2DP/BIs7w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5BB1D687A7; Tue, 9 Dec 2025 17:09:06 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id jG82GSONjt3V; Tue, 9 Dec 2025 17:09:06 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765325342; bh=IygW9TX1kp/+OOopXMQ6rMK2Z1QciyZB1ON2mWs5RUI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e6unVKNRBR+XnZluwRS5jukJFSzoYvTvri8SpFfzfPtVL2z6nr1uKhzslJALQHpbK diCtpzpavJIps2sR7OeFe0Wa/gBNdmBLgacayApDLLkqxZIXkn80BmteM8Obkxt8XG sWPLVA09esTsV1CGcocpoPYkqT4IngsKBMC+eBGlJB/mopsH+1+Tbp7qI9Zn38ZmR7 C8BTC18eOCoE8lU96uYWTodIDrbCFIbzSJjj68rlsitnBa8Ej7lFUfgmTstmzN/3VS fX0rDTjnt4g5FxXHNSE/d15Az1wEYMKpgC/PWqR32n64VnLCrAVI4msVrtUhIhm1lG aGQWJJcsQ4qvQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id A908B689EA; Tue, 9 Dec 2025 17:09:01 -0700 (MST) From: Simon Glass <sjg@u-boot.org> To: U-Boot Concept <concept@u-boot.org> Date: Tue, 9 Dec 2025 17:07:05 -0700 Message-ID: <20251210000737.180797-15-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251210000737.180797-1-sjg@u-boot.org> References: <20251210000737.180797-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: GE2UZYKUN2E3SWXVZJQUS43VO2SIHJKY X-Message-ID-Hash: GE2UZYKUN2E3SWXVZJQUS43VO2SIHJKY X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt <xypron.glpk@gmx.de>, Simon Glass <simon.glass@canonical.com>, Claude <noreply@anthropic.com> X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 14/35] malloc: Fix unused internal_memalign warning with mcheck List-Id: Discussion and patches related to U-Boot Concept <concept.u-boot.org> Archived-At: <https://lists.u-boot.org/archives/list/concept@u-boot.org/message/GE2UZYKUN2E3SWXVZJQUS43VO2SIHJKY/> List-Archive: <https://lists.u-boot.org/archives/list/concept@u-boot.org/> List-Help: <mailto:concept-request@u-boot.org?subject=help> List-Owner: <mailto:concept-owner@u-boot.org> List-Post: <mailto:concept@u-boot.org> List-Subscribe: <mailto:concept-join@u-boot.org> List-Unsubscribe: <mailto:concept-leave@u-boot.org> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit |
| Series |
malloc: Add heap debugging commands and mcheck caller tracking
|
|
Commit Message
Simon Glass
Dec. 10, 2025, 12:07 a.m. UTC
From: Simon Glass <simon.glass@canonical.com> When CONFIG_MCHECK_HEAP_PROTECTION is enabled, dlmemalign_impl() calls dlmalloc_impl() directly since the mcheck wrapper handles alignment. This leaves internal_memalign() unused, causing a compiler warning. Guard internal_memalign() with a preprocessor check so it's only compiled when needed (mcheck disabled or MSPACES enabled). Co-developed-by: Claude <noreply@anthropic.com> Signed-off-by: Simon Glass <simon.glass@canonical.com> --- common/dlmalloc.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/common/dlmalloc.c b/common/dlmalloc.c index b46be1899f0..efeff18653f 100644 --- a/common/dlmalloc.c +++ b/common/dlmalloc.c @@ -5309,6 +5309,7 @@ static mchunkptr try_realloc_chunk(mstate m, mchunkptr p, size_t nb, } #endif /* !defined(__UBOOT__) || !NO_REALLOC_IN_PLACE */ +#if !CONFIG_IS_ENABLED(MCHECK_HEAP_PROTECTION) || MSPACES static void* internal_memalign(mstate m, size_t alignment, size_t bytes) { void* mem = 0; if (alignment < MIN_CHUNK_SIZE) /* must be at least a minimum chunk size */ @@ -5422,6 +5423,7 @@ static void* internal_memalign(mstate m, size_t alignment, size_t bytes) { } return mem; } +#endif /* !CONFIG_MCHECK_HEAP_PROTECTION || MSPACES */ /* Common support for independent_X routines, handling