Rev 3972 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3972 | Rev 4174 | ||
---|---|---|---|
Line 42... | Line 42... | ||
42 | 42 | ||
43 | /** Minimum size to be allocated by malloc */ |
43 | /** Minimum size to be allocated by malloc */ |
44 | #define SLAB_MIN_MALLOC_W 4 |
44 | #define SLAB_MIN_MALLOC_W 4 |
45 | 45 | ||
46 | /** Maximum size to be allocated by malloc */ |
46 | /** Maximum size to be allocated by malloc */ |
47 | #define SLAB_MAX_MALLOC_W 18 |
47 | #define SLAB_MAX_MALLOC_W 22 |
48 | 48 | ||
49 | /** Initial Magazine size (TODO: dynamically growing magazines) */ |
49 | /** Initial Magazine size (TODO: dynamically growing magazines) */ |
50 | #define SLAB_MAG_SIZE 4 |
50 | #define SLAB_MAG_SIZE 4 |
51 | 51 | ||
52 | /** If object size is less, store control structure inside SLAB */ |
52 | /** If object size is less, store control structure inside SLAB */ |
Line 62... | Line 62... | ||
62 | #define SLAB_RECLAIM_ALL 0x01 |
62 | #define SLAB_RECLAIM_ALL 0x01 |
63 | 63 | ||
64 | /* cache_create flags */ |
64 | /* cache_create flags */ |
65 | 65 | ||
66 | /** Do not use per-cpu cache */ |
66 | /** Do not use per-cpu cache */ |
67 | #define SLAB_CACHE_NOMAGAZINE 0x1 |
67 | #define SLAB_CACHE_NOMAGAZINE 0x01 |
68 | /** Have control structure inside SLAB */ |
68 | /** Have control structure inside SLAB */ |
69 | #define SLAB_CACHE_SLINSIDE 0x2 |
69 | #define SLAB_CACHE_SLINSIDE 0x02 |
70 | /** We add magazine cache later, if we have this flag */ |
70 | /** We add magazine cache later, if we have this flag */ |
71 | #define SLAB_CACHE_MAGDEFERRED (0x4 | SLAB_CACHE_NOMAGAZINE) |
71 | #define SLAB_CACHE_MAGDEFERRED (0x04 | SLAB_CACHE_NOMAGAZINE) |
72 | 72 | ||
73 | typedef struct { |
73 | typedef struct { |
74 | link_t link; |
74 | link_t link; |
75 | count_t busy; /**< Count of full slots in magazine */ |
75 | count_t busy; /**< Count of full slots in magazine */ |
76 | count_t size; /**< Number of slots in magazine */ |
76 | count_t size; /**< Number of slots in magazine */ |
Line 139... | Line 139... | ||
139 | 139 | ||
140 | /* malloc support */ |
140 | /* malloc support */ |
141 | extern void *malloc(unsigned int, int); |
141 | extern void *malloc(unsigned int, int); |
142 | extern void *realloc(void *, unsigned int, int); |
142 | extern void *realloc(void *, unsigned int, int); |
143 | extern void free(void *); |
143 | extern void free(void *); |
- | 144 | ||
144 | #endif |
145 | #endif |
145 | 146 | ||
146 | /** @} |
147 | /** @} |
147 | */ |
148 | */ |