Re: [RFC/PATCH] commit-slab.h: Fix memory allocation and addressing

2013-07-29 Thread Junio C Hamano
Ramsay Jones writes: > I was convinced, just by reading the code in the header, that when > used with stride > 1, the memory allocated to a slab would not be > sufficient. (ie it would be too small by: > s->slab_size * (sizeof(**s->slab) * (stride - 1)) > ). So, I had expected t3202-show-bran

[RFC/PATCH] commit-slab.h: Fix memory allocation and addressing

2013-07-27 Thread Ramsay Jones
The slab initialization code includes the calculation of the slab 'elem_size', which is in turn used to determine the size (capacity) of the slab. Each element of the slab represents an array, of length 'stride', of 'elemtype'. (Note that it may be clearer if the define_commit_slab macro parameter