From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by sourceware.org (Postfix) with ESMTPS id 793BE385DC3A for ; Mon, 15 May 2023 14:25:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 793BE385DC3A Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-50db7ec8188so11695596a12.2 for ; Mon, 15 May 2023 07:25:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684160742; x=1686752742; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=CqwCSZLK2sX+xx2Ana9T6OdVAfVvaK6JoNjhhiBGztE=; b=d99gioTOWtY/+SIPd3nLQUxzHTn5utN8KTEJ1U7GYSUFnEpl0eIn7TUsyt3xVyaqdY T95VSyhPwPJ09BJ+is4kqDGp22lFiCE4H2DEU3owWsr0eF7sZm9nYdCO2E+x9EBIw5Td 2q0JZKCOf7r6u4hsa486HoYkFW/tcT329rKHKEKfDodMb90lbtiiB3ACNNDTUakoWkNT W0gwOUHP1L5jBN3/wMlj8qE1yUtQHt19FXlYAmwuT1PHYr/BOd1nX+AkaLCOc/AbQalK aYLUuWh0VGvvCGqttLxxrnIq6x3yM0fXGlt2yRvxrn0BXix1z+dVs/SEElT73LGTiQwK M8Og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684160742; x=1686752742; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CqwCSZLK2sX+xx2Ana9T6OdVAfVvaK6JoNjhhiBGztE=; b=InwZ5lApuhiVYmD7MIRF0SWae3AZlV8IWTUfig4asBT+nUHiwnJw4YzLwUuJkCw/U7 sNGsY7wtjZm4WAw3O7+jIqYCWUHqvnhAknMx++3dmruri4oKPKQPsFUZHu8tXIX0yagM +3I1WEOSQZhM9h6nXJvo+knk79ZJdub64iYQVjnC6DcxNOGakaIvWJfcBsXMBMR6xy+w ffq9h+g/0I/oYroDPq+j9AJI3SOnVL/oVFdy2sPZan5sbWBlkG27XcVCoM4RMhnn6P/D eUspTeqIksKLlEnej/zuSS8z/rhQzuCRHPDyEkVoDDJ94FPGTP3MdvXIsHWH6Ck37BPZ a1gg== X-Gm-Message-State: AC+VfDywEAtebi+lPxxFMhNsQDFbZxfrNbUcmY+Kdf/ZdSJdpQOUiC1y C3AlqbKDR0t5RjpJCg0gFl0= X-Google-Smtp-Source: ACHHUZ7+iy2WXXCCxafAQnzY+Nf/GGXdaiKj7HK3gj1Ho0JhEhDlfJ2ly0OgCMeZ35OGXPi+r4qDtA== X-Received: by 2002:a17:907:ea9:b0:958:5474:a84a with SMTP id ho41-20020a1709070ea900b009585474a84amr34935904ejc.38.1684160741845; Mon, 15 May 2023 07:25:41 -0700 (PDT) Received: from nbbrfq.loc (80-110-214-113.static.upcbusiness.at. [80.110.214.113]) by smtp.gmail.com with ESMTPSA id 26-20020a170906319a00b00966056bd4f4sm9498923ejy.28.2023.05.15.07.25.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 May 2023 07:25:41 -0700 (PDT) Date: Mon, 15 May 2023 16:24:53 +0200 From: Bernhard Reutner-Fischer To: Aldy Hernandez via Gcc-patches Cc: rep.dot.nop@gmail.com, Aldy Hernandez , Andrew MacLeod , Richard Biener , Jakub Jelinek , mjambor@suse.cz Subject: Re: [PATCH] Add auto-resizing capability to irange's [PR109695] Message-ID: <20230515162453.4f2a5e94@nbbrfq.loc> In-Reply-To: <20230515103523.100412-1-aldyh@redhat.com> References: <20230515103523.100412-1-aldyh@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Mon, 15 May 2023 12:35:23 +0200 Aldy Hernandez via Gcc-patches wrote: > +// For resizable ranges, resize the range up to HARD_MAX_RANGES if the > +// NEEDED pairs is greater than the current capacity of the range. > + > +inline void > +irange::maybe_resize (int needed) > +{ > + if (!m_resizable || m_max_ranges == HARD_MAX_RANGES) > + return; > + > + if (needed > m_max_ranges) > + { > + m_max_ranges = HARD_MAX_RANGES; > + wide_int *newmem = new wide_int[m_max_ranges * 2]; > + memcpy (newmem, m_base, sizeof (wide_int) * num_pairs () * 2); > + m_base = newmem; Please excuse my ignorance, but where's the old m_base freed? I think the assignment above does not call the destructor, or does it? thanks, > + } > +} > + > +template > +inline > +int_range::~int_range () > +{ > + if (RESIZABLE && m_base != m_ranges) > + delete m_base; > +}