aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPekka Enberg <penberg@cs.helsinki.fi>2007-05-06 17:48:40 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-07 15:12:50 -0400
commitfd76bab2fa6d8f3ef6b326a4c6ae442fa21d30a4 (patch)
tree66f310ab9d7cdadfb79486700f1e01df7923ec14 /include
parente3ebadd95cb621e2c7436f3d3646447ac9d5c16d (diff)
slab: introduce krealloc
This introduce krealloc() that reallocates memory while keeping the contents unchanged. The allocator avoids reallocation if the new size fits the currently used cache. I also added a simple non-optimized version for mm/slob.c for compatibility. [akpm@linux-foundation.org: fix warnings] Acked-by: Josef Sipek <jsipek@fsl.cs.sunysb.edu> Acked-by: Matt Mackall <mpm@selenic.com> Acked-by: Christoph Lameter <clameter@sgi.com> Signed-off-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>
Diffstat (limited to 'include')
-rw-r--r--include/linux/slab.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 1ef822e31c77..2f8f60ff294a 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -72,8 +72,9 @@ static inline void *kmem_cache_alloc_node(struct kmem_cache *cachep,
72 */ 72 */
73void *__kmalloc(size_t, gfp_t); 73void *__kmalloc(size_t, gfp_t);
74void *__kzalloc(size_t, gfp_t); 74void *__kzalloc(size_t, gfp_t);
75void * __must_check krealloc(const void *, size_t, gfp_t);
75void kfree(const void *); 76void kfree(const void *);
76unsigned int ksize(const void *); 77size_t ksize(const void *);
77 78
78/** 79/**
79 * kcalloc - allocate memory for an array. The memory is set to zero. 80 * kcalloc - allocate memory for an array. The memory is set to zero.