uma_zalloc doubt

Hi, in the file kern/kern_malloc.c the zone for the dynamically allocated memory is created as follows:

Code:
mt_zone = uma_zcreate("mt_zone", sizeof(struct malloc_type_internal), ...

Now, the malloc(9) requests will be managed thru a malloc_type struct that, in turns, contains the malloc_type_internal struct as one of its field (ks_data). The internal struct is bigger than the malloc_type because it includes, in turn, a malloc_type_stats structure not as a pointer (directly). Is this the reason why the uma_zcreate is passed the size of the malloc_type_internal while it will be used to allocate something used thru malloc_type? In other words, should I always pass to uma_zcreate the biggest size of my pieces even if that is not the exact count of bytes I will use?
 
Back
Top