Rev 781 | Rev 788 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 781 | Rev 787 | ||
---|---|---|---|
Line 68... | Line 68... | ||
68 | 68 | ||
69 | link_t link; |
69 | link_t link; |
70 | /* Configuration */ |
70 | /* Configuration */ |
71 | size_t size; /**< Size of SLAB position - align_up(sizeof(obj)) */ |
71 | size_t size; /**< Size of SLAB position - align_up(sizeof(obj)) */ |
72 | int (*constructor)(void *obj, int kmflag); |
72 | int (*constructor)(void *obj, int kmflag); |
73 | void (*destructor)(void *obj); |
73 | int (*destructor)(void *obj); |
74 | int flags; /**< Flags changing behaviour of cache */ |
74 | int flags; /**< Flags changing behaviour of cache */ |
75 | 75 | ||
76 | /* Computed values */ |
76 | /* Computed values */ |
77 | __u8 order; /**< Order of frames to be allocated */ |
77 | __u8 order; /**< Order of frames to be allocated */ |
78 | int objects; /**< Number of objects that fit in */ |
78 | int objects; /**< Number of objects that fit in */ |
Line 101... | Line 101... | ||
101 | 101 | ||
102 | extern slab_cache_t * slab_cache_create(char *name, |
102 | extern slab_cache_t * slab_cache_create(char *name, |
103 | size_t size, |
103 | size_t size, |
104 | size_t align, |
104 | size_t align, |
105 | int (*constructor)(void *obj, int kmflag), |
105 | int (*constructor)(void *obj, int kmflag), |
106 | void (*destructor)(void *obj), |
106 | int (*destructor)(void *obj), |
107 | int flags); |
107 | int flags); |
108 | extern void slab_cache_destroy(slab_cache_t *cache); |
108 | extern void slab_cache_destroy(slab_cache_t *cache); |
109 | 109 | ||
110 | extern void * slab_alloc(slab_cache_t *cache, int flags); |
110 | extern void * slab_alloc(slab_cache_t *cache, int flags); |
111 | extern void slab_free(slab_cache_t *cache, void *obj); |
111 | extern void slab_free(slab_cache_t *cache, void *obj); |