Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w9j8E-001ggB-2O for pgsql-committers@arkaria.postgresql.org; Mon, 06 Apr 2026 12:32:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w9j7B-008NhU-35 for pgsql-committers@arkaria.postgresql.org; Mon, 06 Apr 2026 12:31:38 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w9j7B-008NhL-1t for pgsql-committers@lists.postgresql.org; Mon, 06 Apr 2026 12:31:38 +0000 Received: from meesny.iki.fi ([2001:67c:2b0:1c1::201]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1w9j79-00000000qoB-083y for pgsql-committers@lists.postgresql.org; Mon, 06 Apr 2026 12:31:36 +0000 Received: from [10.0.2.15] (unknown [130.41.208.1]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: hlinnaka) by meesny.iki.fi (Postfix) with ESMTPSA id 4fq7wy0NsmzytZ; Mon, 06 Apr 2026 15:31:29 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1775478690; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qtP7MMCnIiGgAxazvax0ku6MlWbP5qEr1PEncZmVD9A=; b=Kr6/i/23FwaszFtpWiLI9ik4FeFDNvcS/WCJJzWiGSXRMhu8QRy6QQvt+qyzSpgcUAiJy5 ux0b5skw6BuOW5Bxe25Lf4BJz28a71RG61ilF/0ZDmPqAy+PFh5xDQEaXr01cjGhf4/vPL GMnYhEcVQ01nfHVwGErmtdbTIlbJjGs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1775478690; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qtP7MMCnIiGgAxazvax0ku6MlWbP5qEr1PEncZmVD9A=; b=jDWznMa45UdlG8Oc9FY0RgsL1W56c64YDgoL6l9bZRD8+/gTBSc5ppLUOEECuyxEzvVuQm grf7Gus6k8TgDKpBPV4WSdnMEyfQVHk1+UY0NP7AGCXtYZH3HrwgEf3lB2CPBLgqmRq3zn qrXo/3OZWNaScQX61zKNl3e9zRegPM0= ARC-Seal: i=1; a=rsa-sha256; d=iki.fi; s=meesny; cv=none; t=1775478690; b=XxPKC8q6ZtW73iOGYlKCo71ddZsn4W4zkIcFrtWy6V/ho1QXyPRZuG3Hn4N+yRTpbpHbu5 0QHUEcXntDmq40pU8Fytba8sEMqELlFG6RkW/N5kRVw5y+uF5eeGZKtqlhedHAkdhhbIpE sVaPBefMDUbiwJqzI7mM9DrL836Rygw= ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=hlinnaka smtp.mailfrom=hlinnaka@iki.fi Message-ID: Date: Mon, 6 Apr 2026 15:31:28 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: pgsql: Convert all remaining subsystems to use the new shmem allocation To: Michael Paquier Cc: pgsql-committers@lists.postgresql.org References: Content-Language: en-US From: Heikki Linnakangas In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 06/04/2026 08:41, Michael Paquier wrote: > On Sun, Apr 05, 2026 at 11:27:44PM +0000, Heikki Linnakangas wrote: >> Convert all remaining subsystems to use the new shmem allocation API >> >> This removes all remaining uses of ShmemInitStruct() and >> ShmemInitHash() from built-in code. >> >> src/backend/utils/misc/injection_point.c | 57 ++++--- > > drongo, that compiles without USE_INJECTION_POINTS, is complaining > about this bit around line 240: > const ShmemCallbacks InjectionPointShmemCallbacks = { > #ifdef USE_INJECTION_POINTS > .request_fn = InjectionPointShmemRequest, > .init_fn = InjectionPointShmemInit, > #endif > }; > > Link: > https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=drongo&dt=2026-04-06%2004%3A09%3A20 > And the error: > ../pgsql/src/backend/utils/misc/injection_point.c(240): error C2059: syntax error: '}' Oh, I didn't realize that that an empty initializer isn't allowed. > Why not putting the whole InjectionPointShmemCallbacks inside a > USE_INJECTION_POINTS block? We should not care about shmem > allocations when --enable-injection-points is not used. > > subsystemlist.h expects the callbacks to always be defined, so your > intention is to have no ifdefs there. Still, it seems a bit pointless > to me to define callbacks we are not going to use depending on the > build options evoked? Attached is one idea, which I doubt you'll > like. :) Looks perfectly fine to me, I'll push that. Thanks! - Heikki