From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25202 invoked by alias); 30 Nov 2015 20:39:22 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 37261 Received: (qmail 18397 invoked from network); 30 Nov 2015 20:39:18 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version:content-type; bh=r5YNsT+d46HvhmOw3/1hAkc14x74sQz5qEJtW4t0aww=; b=bOpiGnHQRwZs6lZTeelDN7Yeh/z1Ylfdbc7woXmmwJ5tDuFUZxKJDhtZRITsuTpfg6 AbzJpt/pD+MbsLMEV/dGBWXLNgw+Isq4R1DdkwC7no8hbGx4R+QnZK0gkI+lifivECnp vvGkAZoG/9fpdl440tO27qjeZozxDUhWxKLORYXYeYUEEIgNj/L+YtUnbpwxe1ynOOCR 60DdCKcIpEDOFmYA3FXDfzHexnj88PRAi8qU8fyhlF+ZZkxUpx0xz4aHEw7226urXFSg JXlLPD/sHBTJDN+rkg/JhihUko0cdCzhnV45S/+45R6mcGLAdIS07mPOr1R4EYl2W6kr afCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version:content-type; bh=r5YNsT+d46HvhmOw3/1hAkc14x74sQz5qEJtW4t0aww=; b=U40yQvYSzrr5cmsAFo27/3bCvVlLMel5v09ael1vV8RY+m1ViwN5y9AEgsCwVs9JWU y/cZlxknEBMZQYE1XDy2FlnoS4PFRhpVGX4soS9LJBwemDWk1e2tr1tDfomPCnad7GSN 4gW43TjBPqAs4aNIzcQhwD2oB6Jwv2jW726Ss6qgkPInNWH059qsN+amkKntBk3uPn6R Rc0cBHvSObZS0sQT9TWBu18ERjNBNNmS8+Xjj8lDrm0wAJzRFYr/f6DJVVLP4X4bCuta ClpOoUShuBOe+OCPksORiANrxbHjCY+Dv4tl+rKO8i6z3YtpYacA50COFKwTYTb9gEw+ 1dwg== X-Gm-Message-State: ALoCoQlRSpEsubZyPRmWptwVnjdZfEPM4XKOv7Ys/kZq6vwJYTf7YEfhyPEYT6qnacVXI0dDaBWQ X-Received: by 10.98.13.25 with SMTP id v25mr74026037pfi.123.1448915955188; Mon, 30 Nov 2015 12:39:15 -0800 (PST) From: Bart Schaefer Message-Id: <151130123937.ZM28961@torch.brasslantern.com> Date: Mon, 30 Nov 2015 12:39:37 -0800 In-Reply-To: <20151130164210.56d36bfe@pwslap01u.europe.root.pri> Comments: In reply to Peter Stephenson "Re: [PATCH 3/3] Constify two local variables." (Nov 30, 4:42pm) References: <20151130032153.GH2504@tarsus.local2> <20151130093832.5321126d@pwslap01u.europe.root.pri> <20151130155945.GD10968@tarsus.local2> <20151130164210.56d36bfe@pwslap01u.europe.root.pri> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: [PATCH 3/3] Constify two local variables. MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Nov 30, 4:42pm, Peter Stephenson wrote: } } As Bart says, setfn() expects a permanently allocated values; if it } doesn't neeed it, it's up to the setfn in question to convert the value } and then free what's passed in. Thinking about it, it is quite likely that this makes it impossible to optimize in the way Daniel wants. At a very low level, we can't swap values into an existing (char**) representing an array parameter. All the setfn() implementations would have to be updated to notice when the pointer passed in is the same as the pointer already in the param struct and skip the free, or something like that.