Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m0S0U-000347-Bf for pgsql-hackers@arkaria.postgresql.org; Mon, 05 Jul 2021 17:03:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m0S0T-00071x-BH for pgsql-hackers@arkaria.postgresql.org; Mon, 05 Jul 2021 17:03:41 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m0S0T-00071p-3O for pgsql-hackers@lists.postgresql.org; Mon, 05 Jul 2021 17:03:41 +0000 Received: from mail-io1-xd2a.google.com ([2607:f8b0:4864:20::d2a]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1m0S0O-0005LF-E2 for pgsql-hackers@lists.postgresql.org; Mon, 05 Jul 2021 17:03:40 +0000 Received: by mail-io1-xd2a.google.com with SMTP id y8so4216675iop.13 for ; Mon, 05 Jul 2021 10:03:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=qDaru/x6AgFEAYapzDD1hNtCIUVcJK1RpZ7JVFnTKb0=; b=XtbfqVH6/aQTN8ybdStbW/+tkeFTs39u4EDjOyexiRwYZNkhTparvTprYmEOV7XA7Y SWSNo00v3ECZNoJN8BjRbPh9MxsdZpK9eyOkMrt9dpLTdhQSD9dQp620sOo2TiYYNp2u zPuyOAQwiLl3NEMvUBIecoGvlEtoS6lsgjhF9F5fFcFngEmRUqvNbqoFwPOdlBdkSPZY qmY0SD5PzHfERnXsxwQf79g7eflSY9PB9FoZh4xoKr/x8nNUC5os+Ruzjq83+Vs694dv QK/86liSN1+UcZfPn/9Ev3YXvDR9MXunh3/5zYUlprZyLD50mSYyvvlbcKQeqNep1tTt vXXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=qDaru/x6AgFEAYapzDD1hNtCIUVcJK1RpZ7JVFnTKb0=; b=Iz7ouH6FFUO1B0OhvPwp/BoKZdFvsrwPTo3AL5yDmyhrIqcTbt8HlPq6aX5BMLLL4a 24rWbXGb7YtODUQLMLv59B8lWPs1CZaR7L4k3F/ouWXRIfuNtdg/ZKJKeD4CnjF2exGq vg+cfiMxZFJkHkD+DzqkbzQbIVdAR/EJVV7ITTySBjMJ80icUCvIDk09em9Y4kenfDnP 1h6+thoYGaL3PIAGeg0VjRkdpVagrB4/87jfqbzcnwt/Q315CK/9P8t3cggeliBQ3ZNQ p47MOX9qs9eATPd1OoiYAS1ZKeKN2ayD71Puhtna56sp+gLqdLDCUcVIbBqlidgOVQAT 60Zg== X-Gm-Message-State: AOAM5318fFtGj7q32LJ6YGDrV0fHE8m3tRwKfW2jwJGfi9kPb+0vnayg r8GJLfXc4u+NijhR2qfAAeky/A== X-Google-Smtp-Source: ABdhPJwvMlgLspF/QU/hwwjD2lmf9MVY7bsYOJ1zAKLNW8urqbenVksCpTxX0uSApmsVmpScaD9koA== X-Received: by 2002:a05:6638:2612:: with SMTP id m18mr13385247jat.54.1625504614785; Mon, 05 Jul 2021 10:03:34 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id f3sm6040095ils.44.2021.07.05.10.03.34 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Jul 2021 10:03:34 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 5CFA2800C6F; Mon, 5 Jul 2021 12:03:33 -0500 (CDT) Date: Mon, 5 Jul 2021 12:03:33 -0500 From: Justin Pryzby To: David Rowley Cc: Nitin Jadhav , Zhihong Yu , pgsql-hackers@lists.postgresql.org Subject: Re: Removed extra memory allocations from create_list_bounds Message-ID: <20210705170333.GA21248@telsasoft.com> References: <20210516170029.GB373@telsasoft.com> <20210517150310.GG373@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Also, if you're going to remove the initializations here, maybe you'd also change i and j to C99 "for" declarations like "for (int i=0, j=0; ...)" - PartitionListValue **all_values = NULL; - ListCell *cell; - int i = 0; - int ndatums = 0; + PartitionListValue *all_values; + int i; + int j; + int ndatums; Same in get_non_null_list_datum_count() -- Justin