[PATCH] Unify malloc locking.

Will Newton will.newton@linaro.org
Mon Mar 17 12:06:00 GMT 2014


On 3 March 2014 15:58, Ondřej Bílka <neleai@seznam.cz> wrote:
> Hi, as another refactoring this moves logic of all allocation to
> pass through one place, function _mid_malloc. There a things like what
> arena to use, retrying with different one are placed. An arena used
> could be obtained as an argument.
>
> I merged arena_lock and arena_lookup macros there as they were used only
> at that place and writing these explicitly will make modifications
> easier.
>
> There is still a custom locking needed for realloc which would be
> additional case that we need to consider.
>
> I did a minimal change to make hooks work, I plan to add a checksum
> based checks which would be stronger than we have now.
>
> Comments?

This patch on its own is quite hard to review - it refactors the code
but it is not clear why the new shape of the code is better than the
old shape of the code, and with a fair number of lines changed in a
quite complex bit of code it is quite a bit of effort to review.

It might be better for review purposes to put your malloc improvement
patches on a development branch so people can see where the
refactoring steps are leading rather than having to review refactor
patches singly.

-- 
Will Newton
Toolchain Working Group, Linaro



More information about the Libc-alpha mailing list