All of lore.kernel.org
 help / color / mirror / Atom feed
* [TECH TOPIC] Implementing malloc
@ 2026-06-29 14:29 Matthew Wilcox
  2026-06-29 15:07 ` Dan Carpenter
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Matthew Wilcox @ 2026-06-29 14:29 UTC (permalink / raw)
  To: ksummit

malloc() is a standard part of the C library.  Yet we force new Linux
programmers to learn the difference between vmalloc(), kmalloc() and
kvmalloc().  They even have to acquire an understanding of the difference
between GFP_KERNEL and GFP_ATOMIC.  If they are particularly unlucky,
they may have to understand other combinations of GFP flags.

This topic proposes that we should implement malloc() and calloc().
Various options will be discussed, their increasing implementation
complexity corresponding to utility in a greater range of situations.
This will also benefit Rust as we can use the same infrastructure to
implement std::alloc.

We'll also discuss the semantics of corner cases (fallibility, zero
sized allocations, overflowing allocations and very large allocations)
as well as out-of-bounds and use-after-free detection.

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2026-06-30 18:59 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-29 14:29 [TECH TOPIC] Implementing malloc Matthew Wilcox
2026-06-29 15:07 ` Dan Carpenter
2026-06-29 15:21   ` H. Peter Anvin
2026-06-29 15:31   ` Matthew Wilcox
2026-06-29 16:00     ` Vlastimil Babka (SUSE)
2026-06-29 16:37     ` H. Peter Anvin
2026-06-29 16:48 ` Alexey Dobriyan
2026-06-29 16:48 ` H. Peter Anvin
2026-06-29 18:19   ` Matthew Wilcox
2026-06-29 18:22     ` H. Peter Anvin
2026-06-29 18:29     ` Mark Brown
2026-06-29 18:37       ` Vlastimil Babka (SUSE)
2026-06-30 18:53     ` Steven Rostedt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.