Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] Optimization of getarrvalue()



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