/shark/trunk/drivers/linuxc26/include/linux/slab.h |
---|
76,24 → 76,6 |
static inline void *kmalloc(size_t size, int flags) |
{ |
if (__builtin_constant_p(size)) { |
int i = 0; |
#define CACHE(x) \ |
if (size <= x) \ |
goto found; \ |
else \ |
i++; |
#include "kmalloc_sizes.h" |
#undef CACHE |
{ |
extern void __you_cannot_kmalloc_that_much(void); |
__you_cannot_kmalloc_that_much(); |
} |
found: |
return kmem_cache_alloc((flags & GFP_DMA) ? |
malloc_sizes[i].cs_dmacachep : |
malloc_sizes[i].cs_cachep, flags); |
} |
return __kmalloc(size, flags); |
} |