Revision ae80a2de lib/slab.c

View differences:

lib/slab.c
51 51

  
52 52
struct slab {
53 53
  resource r;
54
  unsigned size;
54
  uint size;
55 55
  list objs;
56 56
};
57 57

  
......
71 71
};
72 72

  
73 73
slab *
74
sl_new(pool *p, unsigned size)
74
sl_new(pool *p, uint size)
75 75
{
76 76
  slab *s = ralloc(p, &sl_class);
77 77
  s->size = size;
......
144 144

  
145 145
struct slab {
146 146
  resource r;
147
  unsigned obj_size, head_size, objs_per_slab, num_empty_heads, data_size;
147
  uint obj_size, head_size, objs_per_slab, num_empty_heads, data_size;
148 148
  list empty_heads, partial_heads, full_heads;
149 149
};
150 150

  
......
185 185
 * objects of size @size can be allocated.
186 186
 */
187 187
slab *
188
sl_new(pool *p, unsigned size)
188
sl_new(pool *p, uint size)
189 189
{
190 190
  slab *s = ralloc(p, &sl_class);
191
  unsigned int align = sizeof(struct sl_alignment);
191
  uint align = sizeof(struct sl_alignment);
192 192
  if (align < sizeof(int))
193 193
    align = sizeof(int);
194 194
  s->data_size = size;
......
214 214
  struct sl_head *h = xmalloc(SLAB_SIZE);
215 215
  struct sl_obj *o = (struct sl_obj *)((byte *)h+s->head_size);
216 216
  struct sl_obj *no;
217
  unsigned int n = s->objs_per_slab;
217
  uint n = s->objs_per_slab;
218 218

  
219 219
  h->first_free = o;
220 220
  h->num_full = 0;

Also available in: Unified diff