Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Commits on Jul 25, 2008
  1. @tpetazzoni @torvalds

    inflate: refactor inflate malloc code

    tpetazzoni authored torvalds committed
    Inflate requires some dynamic memory allocation very early in the boot
    process and this is provided with a set of four functions:
    The old inflate code used a mark/release strategy rather than implement
    free.  This new version instead keeps a count on the number of outstanding
    allocations and when it hits zero, it resets the malloc arena.
    This allows removing all the mark and release implementations and unifying
    all the malloc/free implementations.
    The architecture-dependent code must define two addresses:
     - free_mem_ptr, the address of the beginning of the area in which
       allocations should be made
     - free_mem_end_ptr, the address of the end of the area in which
       allocations should be made. If set to 0, then no check is made on
       the number of allocations, it just grows as much as needed
    The architecture-dependent code can also provide an arch_decomp_wdog()
    function call.  This function will be called several times during the
    decompression process, and allow to notify the watchdog that the system is
    still running.  If an architecture provides such a call, then it must
    define ARCH_HAS_DECOMP_WDOG so that the generic inflate code calls
    Work initially done by Matt Mackall, updated to a recent version of the
    kernel and improved by me.
    [ coding-style fixes]
    Signed-off-by: Thomas Petazzoni <>
    Cc: Matt Mackall <>
    Cc: Richard Henderson <>
    Cc: Ivan Kokshaysky <>
    Cc: Mikael Starvik <>
    Cc: Jesper Nilsson <>
    Cc: Haavard Skinnemoen <>
    Cc: David Howells <>
    Cc: Ingo Molnar <>
    Cc: Thomas Gleixner <>
    Cc: Andi Kleen <>
    Cc: "H. Peter Anvin" <>
    Acked-by: Paul Mundt <>
    Acked-by: Yoshinori Sato <>
    Signed-off-by: Andrew Morton <>
    Signed-off-by: Linus Torvalds <>
Commits on Apr 29, 2008
  1. @tpetazzoni @torvalds

    directly use kmalloc() and kfree() in init/initramfs.c

    tpetazzoni authored torvalds committed
    Instead of using the malloc() and free() wrappers needed by the
    lib/inflate.c code for allocations, simply use kmalloc() and kfree() in the
    initramfs code.  This is needed for a further lib/inflate.c-related cleanup
    patch that will remove the malloc() and free() functions.
    Take that opportunity to remove the useless kmalloc() return value
    Based on work done by Matt Mackall.
    Signed-off-by: Thomas Petazzoni <>
    Signed-off-by: Matt Mackall <>
    Cc: Jan Engelhardt <>
    Signed-off-by: Andrew Morton <>
    Signed-off-by: Linus Torvalds <>
Something went wrong with that request. Please try again.