Re: Allocating small amounts of memory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



--- Ankit Jain <radical@corewars.org> wrote:
> Hey,
> I have to allocate small amounts of memory (lots of strings
> actually)
> ranging from 1 byte to 200-300 bytes (or can be more also!) in
> kernel-space. If i use kmalloc that would allocate memory in
> terms of "pages" ..right? So that would waste too much memory.

 No. kmalloc() can allocate memory in chunks of size smaller
( and bigger) than a page. The range is 32 bytes to 128 kb.
You can pass any size in that range, but it will be rounded
to the next higher power-of-2.

Hope this helps,
Ravi.




__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux