kernel-ark/mm
Christoph Lameter 272c1d21d6 SLUB: return ZERO_SIZE_PTR for kmalloc(0)
Instead of returning the smallest available object return ZERO_SIZE_PTR.

A ZERO_SIZE_PTR can be legitimately used as an object pointer as long as it
is not deferenced.  The dereference of ZERO_SIZE_PTR causes a distinctive
fault.  kfree can handle a ZERO_SIZE_PTR in the same way as NULL.

This enables functions to use zero sized object. e.g. n = number of objects.

	objects = kmalloc(n * sizeof(object));

	for (i = 0; i < n; i++)
		objects[i].x = y;

	kfree(objects);

Signed-off-by: Christoph Lameter <clameter@sgi.com>
Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-06-08 17:23:33 -07:00
..
allocpercpu.c
backing-dev.c
bootmem.c
bounce.c
fadvise.c
filemap_xip.c Detach sched.h from mm.h 2007-05-21 09:18:19 -07:00
filemap.c Fix: find_or_create_page skips cpuset memory spreading. 2007-05-16 21:19:15 -07:00
filemap.h
fremap.c
highmem.c [PATCH] i386: PARAVIRT: add kmap_atomic_pte for mapping highpte pages 2007-05-02 19:27:15 +02:00
hugetlb.c pretend cpuset has some form of hugetlb page reservation 2007-05-09 12:30:49 -07:00
internal.h Make page->private usable in compound pages 2007-05-07 12:12:53 -07:00
Kconfig sh64: generic quicklist support. 2007-05-14 09:55:35 +09:00
madvise.c Detach sched.h from mm.h 2007-05-21 09:18:19 -07:00
Makefile Quicklists for page table pages 2007-05-07 12:12:54 -07:00
memory_hotplug.c memory hotplug: fix unnecessary calling of init_currenty_empty_zone() 2007-06-01 08:18:29 -07:00
memory.c mm: more rmap checking 2007-05-17 05:23:06 -07:00
mempolicy.c
mempool.c
migrate.c
mincore.c
mlock.c Detach sched.h from mm.h 2007-05-21 09:18:19 -07:00
mmap.c Fix occurrences of "the the " 2007-05-09 08:57:56 +02:00
mmzone.c
mprotect.c
mremap.c
msync.c Detach sched.h from mm.h 2007-05-21 09:18:19 -07:00
nommu.c move die notifier handling to common code 2007-05-08 11:15:04 -07:00
oom_kill.c oom: fix constraint deadlock 2007-05-07 12:12:55 -07:00
page_alloc.c m68k: discontinuous memory support 2007-05-31 07:58:14 -07:00
page_io.c
page-writeback.c consolidate generic_writepages and mpage_writepages 2007-05-11 08:29:35 -07:00
pdflush.c
prio_tree.c
quicklist.c Quicklists for page table pages 2007-05-07 12:12:54 -07:00
readahead.c readahead: code cleanup 2007-05-07 12:12:52 -07:00
rmap.c mm: more rmap checking 2007-05-17 05:23:06 -07:00
shmem_acl.c
shmem.c mount -t tmpfs -o mpol=: check nodes online 2007-06-08 17:23:32 -07:00
slab.c slab: fix alien cache handling 2007-06-08 17:23:32 -07:00
slob.c Remove SLAB_CTOR_CONSTRUCTOR 2007-05-17 05:23:04 -07:00
slub.c SLUB: return ZERO_SIZE_PTR for kmalloc(0) 2007-06-08 17:23:33 -07:00
sparse.c x86_64: allocate sparsemem memmap above 4G 2007-06-01 08:18:27 -07:00
swap_state.c
swap.c Add suspend-related notifications for CPU hotplug 2007-05-09 12:30:56 -07:00
swapfile.c mm: make read_cache_page synchronous 2007-05-07 12:12:51 -07:00
thrash.c Bug in mm/thrash.c function grab_swap_token() 2007-05-11 08:29:32 -07:00
tiny-shmem.c
truncate.c fs: convert core functions to zero_user_page 2007-05-09 12:30:55 -07:00
util.c
vmalloc.c Make __vunmap static 2007-05-17 05:23:04 -07:00
vmscan.c Add suspend-related notifications for CPU hotplug 2007-05-09 12:30:56 -07:00
vmstat.c Detach sched.h from mm.h 2007-05-21 09:18:19 -07:00