Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Patch for curses module
- X-seq: zsh-workers 36511
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: Patch for curses module
- Date: Sat, 12 Sep 2015 18:45:46 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=kFrhnNbwCBFKUpMS01mAhxmn72e0poXhZJ1386gXFuQ=; b=doi77eioRP3HR/pOnim8o8/2nEAusyHmWSdw+Kx4iF6mhEtA9Sv0EA0MdOOrfuP4HK Sw8G6jr7yb7ZZyC5jI3/XmEK53pEKq8jmgHajOFKGi6PYPX3U7HGdoOG0W2UYgJ1utu0 88JLJCTw8f8t1CQRFc+OhtgKsTfXioX8kYYbtESFv9XWHZQlOB5Xj/zmkv/jbJHggEvi y2sh9u291QjlZIz33vqMYeR1/enQjQdqgpY470ju3Vj/fhDcVJbA9BlvcZC8ELc1Y/tS ddF48nGvOB7iJ5kw7eOK5yqlkqeRHoq390cZ5gwxkmgM88VA/kNijnrO4CmFQohDTKq4 x45A==
- In-reply-to: <150912090835.ZM11765@torch.brasslantern.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVAKmGZrDfbA-A8bpZ+6kM+ibBr6pkFbG_5=jumLJcREFw@mail.gmail.com> <CAKc7PVAXVXOzwr3MO_oyBEgaWuSBHXz+CJH62UW3p73w=v+ipQ@mail.gmail.com> <150912090835.ZM11765@torch.brasslantern.com>
With this patch color pairs are created at first use and then found
and returned with no errors. So the patch helps.
Wonder if there is a workaround to have memory from zalloc() cleared
e.g. by proper sequence of calls in zsh script or by an environment
variable, etc.
Best regards,
Sebastian Gniazdowski
On 12 September 2015 at 18:08, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Sep 12, 4:44pm, Sebastian Gniazdowski wrote:
> }
> } As it can be seen, hash misses are caused by the DISABLED flag ( "if
> } (hp->flags & DISABLED) {" in function gethashnode). I attach two files
> } with debug prints that produced the output. --- lines are hash table
> } dumps, == are gethashnode() interiors. Can someone explain why
> } sometimes a node has the DISABLED flag?
>
> Try this?
>
>
> diff --git a/Src/Modules/curses.c b/Src/Modules/curses.c
> index 0054aef..64329f6 100644
> --- a/Src/Modules/curses.c
> +++ b/Src/Modules/curses.c
> @@ -370,7 +370,7 @@ zcurses_colorget(const char *nam, char *colorpair)
> return NULL;
> }
>
> - cpn = (Colorpairnode)zalloc(sizeof(struct colorpairnode));
> + cpn = (Colorpairnode)zshcalloc(sizeof(struct colorpairnode));
>
> if (!cpn) {
> zsfree(cp);
> @@ -462,7 +462,7 @@ zccmd_init(const char *nam, char **args)
> use_default_colors();
> #endif
> /* Initialise the default color pair, always 0 */
> - cpn = (Colorpairnode)zalloc(sizeof(struct colorpairnode));
> + cpn = (Colorpairnode)zshcalloc(sizeof(struct colorpairnode));
> if (cpn) {
> cpn->colorpair = 0;
> addhashnode(zcurses_colorpairs,
Messages sorted by:
Reverse Date,
Date,
Thread,
Author