EmbLogic's Blog

char_dri

pls tell me the different issue associated with malloc and kmalloc ? and what is different betn them?

4 Responses to char_dri

  1. malloc is used in application layer and its header file is malloc.h

    Kmalloc is used in kernel space and its header is slab.h (versions depandable ) or code_linux.h

  2. Another Difference is —

    kmalloc returns physically contiguous memory, malloc does
    not guarantee anything about the physical memory mapping.

    The other main difference is that kmalloc’ed memory is
    reserved and locked, it cannot be swapped. malloc does not
    actually allocate physical memory. Physical memory gets
    mapped later, during use.

  3. malloc funtion resides inside the stdlib.h and when we use it we have whole os facilities like swaping,virtual memory and etc so it uses the logical mapping to allocate the memory but on the other hand at kmalloc we have only kernel space and we attack on memory direct like statically…….so it allocate physical memory by kernel.

  4. kamran says:

    Malloc

    Function: Malloc is used for applying for the memory space dynamically, it is not a key word, but a function of an application memory

    Usage:

    Malloc return one the intersection of memory and indicator of address, will recycle empty indicator null back to, the ones that should pay attention to are herein, when the memory is no longer used, spend free ‘ Release that the function goes on to the memory.

    Kmalloc and malloc difference..malloc allocates memory from HEAP. whereas kmalloc can allocate from normal/dma/high mem.

Leave a Reply to Vaibhav Singh Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>