summaryrefslogtreecommitdiff
path: root/pfinet.old/glue-include/linux/malloc.h
blob: 46ae1051c62426f4f49456e05d2b5bd05fc576d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#ifndef _HACK_MALLOC_H_
#define _HACK_MALLOC_H_

#include <linux/mm.h>

#include <stdlib.h>

static inline void *kmalloc (size_t sz, int ignored) { return malloc (sz); }
static inline void kfree (void *ptr) { free (ptr); }
static inline void kfree_s (void *ptr, size_t sz) { free (ptr); }
#define free(x) kfree(x)	/* just don't ask */


typedef struct kmem_cache_s kmem_cache_t;

#define	SLAB_HWCACHE_ALIGN 0	/* flag everybody uses */
#define SLAB_ATOMIC 0


extern kmem_cache_t *kmem_cache_create(const char *, size_t, size_t, unsigned long,
				       void (*)(void *, kmem_cache_t *, unsigned long),
				       void (*)(void *, kmem_cache_t *, unsigned long));
extern void *kmem_cache_alloc(kmem_cache_t *, int);
extern void kmem_cache_free(kmem_cache_t *, void *);


#endif