Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] Optimization of getarrvalue()
- X-seq: zsh-workers 39879
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: [PATCH] Optimization of getarrvalue()
- Date: Tue, 8 Nov 2016 13:58:20 -0800
- 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-transfer-encoding; bh=xw/MIjFnJj/1vHbBO+fDEZmIMuL1vTWR0vbA+pWye7c=; b=cIjUIO/7ilYf1C9LevErQX6Tm02Ogygkc1ICeSvqK6DlAlRcKL/+vVIR3zsQMpS5Ib eSKuSISz26AgatMBG66vvyCoxgxtit2wgby4Z4lAKDceVorDpEobHdsuqIbt/ryvv9vr PuKEQsZkkcLjgYCoLMHTDJ/oguRheV7s/v3DD+H/pZe80+ayS+gHS1fF5E7pYAwxGxqA LVYY/1+OXZ/sxjkS/99clAZf6a+dHp00lmfvYuepF4oDc/NNIvN+lYokCzPhn00iTZbr B/V7VQq9FQ5nF9MuIOxrFu9dQqxwgp9HbEM5sEje9cVLfYTlHWSd9z13RivbsZ8td14z nUjg==
- In-reply-to: <1478635899.1897979.781551353.05792438@webmail.messagingengine.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: <1478635899.1897979.781551353.05792438@webmail.messagingengine.com>
On Nov 8, 12:11pm, Sebastian Gniazdowski wrote:
}
} More, I suspect a memory leak in following code that has been replaced:
}
} if (v->end <= v->start)
} s[0] = NULL;
} else if (arrlen_ge(s, v->end - v->start))
} s[v->end - v->start] = NULL;
}
} That code adapts array according to end index â?? however it seems that
} strings after the NULL are then unreachable to freearray() ?
You perhaps haven't noticed that arrdup() uses zhalloc() and dupstring()?
Everything is on the heap and is freed by freeheap() or popheap(), never
by freearray().
} Interesting that some tests fail (e.g. ./Y03arguments.ztst) if I here
} duplicate nular instead of doing:
I'm not sure I understand from this exactly what you're describing, but
it seems likely to have something to do with confusing zsh heap memory
with directly-malloc'd memory.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author