From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7099 invoked by alias); 13 Sep 2015 21:02:56 -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: 36532 Received: (qmail 25030 invoked from network); 13 Sep 2015 21:02:55 -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 autolearn=ham autolearn_force=no version=3.4.0 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=Zb2c8KVY5xjQUzJjdlbpPej4STM6IbGnVjp30zmbrhc=; b=PDN/PWIm11NxEnspdXRSq7rlc+MoV2M4R/mSj3I9ZjcA2L8IvAMm0B7lGUY4Bjn8F7 81eb47PLHQ9in/g+DDCmLmF4KoRFnMP09EPKiqTgpdKQdyBO7EQcNVMomp9wZm/kSCCX PPSrUP/wE50gMM8HJPhlaRshlyIScuX8t6+Vk5b59byVDNN6oziv2/degmubxiuhIaqE 05opXii1flioZyI+ruPRPBIUUptXBaO4pB7gTcWVY//BOgNmJN4tR5/BlDVJLNYIu/tL CLYw/PpTK99sbv8ApOaGb/RM+P+AOCOfJh+A+GJqEHiW4SQaT4wMcTjG571HORxh4I+w Hk/w== X-Gm-Message-State: ALoCoQnzY72jXDUpsmHJ0nS2SpPrX2H0DCCYcCzg9AHXNgFGGnQTei4lMORcyfXUq5zmnvfKk4aH X-Received: by 10.202.9.132 with SMTP id 126mr7480553oij.4.1442178172303; Sun, 13 Sep 2015 14:02:52 -0700 (PDT) From: Bart Schaefer Message-Id: <150913140249.ZM25122@torch.brasslantern.com> Date: Sun, 13 Sep 2015 14:02:49 -0700 In-Reply-To: Comments: In reply to Sebastian Gniazdowski "Re: Patch for curses module" (Sep 13, 9:35pm) References: <150912090835.ZM11765@torch.brasslantern.com> <150912113349.ZM12036@torch.brasslantern.com> <150913094735.ZM23422@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: Patch for curses module MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Sep 13, 9:35pm, Sebastian Gniazdowski wrote: } } Maybe local means that the memory comes from stack, while zalloc() } works on heap? No, parameters are always allocated from the global malloc arena, even if declared local. Zsh's internal heap (which is itself allocated from malloc) is is used only when expanding $param expressions. } I tried with global variables but still no luck though. } } I have printed sizeof of the struct and it's 16, and 32 on 64 bit machine. Then your best bet is to create a single parameter 32 bytes in size. But note that an assignment like that is three allocations, a struct param plus the name and value, so when you get around to allocating the colorpairnode you're just as likely to get the freed param as the space used for the value; but scalars have a 0 in the flags (whereas PM_ARRAY and DISABLED use the same bits) so that may be OK.