Rev 767 | Rev 776 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 767 | Rev 771 | ||
---|---|---|---|
Line 31... | Line 31... | ||
31 | 31 | ||
32 | #include <list.h> |
32 | #include <list.h> |
33 | #include <synch/spinlock.h> |
33 | #include <synch/spinlock.h> |
34 | #include <arch/atomic.h> |
34 | #include <arch/atomic.h> |
35 | 35 | ||
- | 36 | /** Minimum size to be allocated by malloc */ |
|
- | 37 | #define SLAB_MIN_MALLOC_W 3 |
|
- | 38 | ||
- | 39 | /** Maximum size to be allocated by malloc */ |
|
- | 40 | #define SLAB_MAX_MALLOC_W 17 |
|
- | 41 | ||
36 | /** Initial Magazine size (TODO: dynamically growing magazines) */ |
42 | /** Initial Magazine size (TODO: dynamically growing magazines) */ |
37 | #define SLAB_MAG_SIZE 4 |
43 | #define SLAB_MAG_SIZE 4 |
38 | 44 | ||
39 | /** If object size is less, store control structure inside SLAB */ |
45 | /** If object size is less, store control structure inside SLAB */ |
40 | #define SLAB_INSIDE_SIZE (PAGE_SIZE >> 3) |
46 | #define SLAB_INSIDE_SIZE (PAGE_SIZE >> 3) |
41 | 47 | ||
42 | /** Maximum wasted space we allow for cache */ |
48 | /** Maximum wasted space we allow for cache */ |
43 | #define SLAB_MAX_BADNESS(cache) ((PAGE_SIZE << (cache)->order >> 2)) |
49 | #define SLAB_MAX_BADNESS(cache) ((PAGE_SIZE << (cache)->order) >> 2) |
44 | 50 | ||
45 | /* slab_reclaim constants */ |
51 | /* slab_reclaim constants */ |
46 | #define SLAB_RECLAIM_ALL 0x1 /**< Reclaim all possible memory, because |
52 | #define SLAB_RECLAIM_ALL 0x1 /**< Reclaim all possible memory, because |
47 | * we are in memory stress */ |
53 | * we are in memory stress */ |
48 | 54 | ||
Line 107... | Line 113... | ||
107 | extern void slab_cache_init(void); |
113 | extern void slab_cache_init(void); |
108 | 114 | ||
109 | /* KConsole debug */ |
115 | /* KConsole debug */ |
110 | extern void slab_print_list(void); |
116 | extern void slab_print_list(void); |
111 | 117 | ||
- | 118 | /* Malloc support */ |
|
- | 119 | extern void * kalloc(unsigned int size, int flags); |
|
- | 120 | extern void kfree(void *obj); |
|
- | 121 | ||
112 | #endif |
122 | #endif |