From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server-vie001.gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,URIBL_DBL_BLOCKED_OPENDNS, URIBL_ZEN_BLOCKED_OPENDNS autolearn=ham autolearn_force=no version=3.4.6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=new2025; t=1757687989; bh=HICn8aCsHTxFr2CHEj6/8otcOhPfLiazNr9RtQlXwC8=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type:Content-Transfer-Encoding:Message-ID:Date:From: Reply-To:Subject:To:Cc:In-Reply-To:References:Resent-Date: Resent-From:Resent-To:Resent-Cc:User-Agent:Content-Type: Content-Transfer-Encoding; b=s87ln8tXDe9nP72yd8wifJzBlqYQ3IL0hEIoYXbl/dERcPjigicfTw5nKne8ly3Rc HRbahVFNmRNGAr/+RPTnapQr+DNupKj3t3Q93UNogMVO8FiOyj8nXR6a1D0M6WS9/j qGBbsscc4w6plZbvfJ3klcAY2tIFMTpDCgEGcxmM436ZFyPE6ejaIyRc7WJrWF0avb lvsXIXKae2avfPIg5RcJPzoivus3vHSMf8uJzjmDuqO92RJPb8SijGjyTzk+6L1Ple umeWlj2v1Hn3jKzrovTssQyUYWrnKoMPj0vbjbOs86htqjlxIIP3bWEYVm+w0bsGwI mP3H3BzG27vuQ== Received: from mail-pg1-f179.google.com (mail-pg1-f179.google.com [209.85.215.179]) by server-vie001.gnuweeb.org (Postfix) with ESMTPSA id 8247431279A0 for ; Fri, 12 Sep 2025 14:39:49 +0000 (UTC) Received: by mail-pg1-f179.google.com with SMTP id 41be03b00d2f7-b54b3cafdcaso294367a12.0 for ; Fri, 12 Sep 2025 07:39:49 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCXVW/hWGVLKVxjSDxV4jMlGdinexPSlfENkO7ah7jvS750iRBMszAwWlkgu/c0q2N3gZyeY@vger.gnuweeb.org X-Gm-Message-State: AOJu0YxH2pykSbQ7i5CY+6yXHRPIZBwONG6syuT7mcwKOIgJriNH3AJp knesdWVsGUZZVqvi4RIY/tNjkZoh134Ugv/5fz8AvmxDHY6OVXU8OLXta1pwKNfqBnHDE/O7BBr 7HcQ501TwO+Uc1EW3MEpBO2bkT/oKnYc= X-Google-Smtp-Source: AGHT+IHAauDZ3c3Nr/gBX5WfUXMqU6NpKjvbU/1xrXx2LBD5Oa6dCmkcrSbjrKtKrGOEhtlxFOSzuZtI/PPrewxsJhI= X-Received: by 2002:a17:90b:4b0e:b0:32d:d408:e86 with SMTP id 98e67ed59e1d1-32de4f78973mr3869448a91.7.1757687987879; Fri, 12 Sep 2025 07:39:47 -0700 (PDT) MIME-Version: 1.0 References: <20250910104326.580778-1-reyuki@gnuweeb.org> <20250910104326.580778-3-reyuki@gnuweeb.org> In-Reply-To: From: Alviro Iskandar Setiawan Date: Fri, 12 Sep 2025 21:39:36 +0700 X-Gmail-Original-Message-ID: X-Gm-Features: Ac12FXwu46FVzE6_O8Qr_NZBPeBzmBvXMEfjBDte8tJPNOOm4WMT_kPaMqEoh78 Message-ID: Subject: Re: [PATCH gwproxy v10 2/2] gwproxy: refactor code base to add experimental raw DNS backend To: Ahmad Gani Cc: Ammar Faizi , "GNU/Weeb Mailing List" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: On Fri, Sep 12, 2025 at 5:37=E2=80=AFPM Ahmad Gani wrote: > In this case, would it be better to allocate both sess_map and stack.arr > in a single block, so we only call realloc once? Why would it be better? I don't think it's worth adding more complexity around it just to get a non noticeable performance gain, unless you have the numbers? It'll complicate the reallocation much, as you have to memmove() around the values yourself. In fact, realloc() may return the same pointer if it internally doesn't need to expand, or may even use mremap() in case the memory was directly allocated via mmap() to expand it without the need to call memmove(). --=20 Software Engineer & ITPM Officer Alviro Iskandar Setiawan +1 908 777 0074