Rework r281162. Indeed, the flexible array member is preferable here.

Suggested by:   Justin T. Gibbs

MFC after:	3 days
This commit is contained in:
Dmitry Chagin 2015-04-12 06:21:58 +00:00
parent 517aea2c14
commit 51cfb0be84
2 changed files with 2 additions and 2 deletions

View File

@ -1822,7 +1822,7 @@ uma_startup(void *bootmem, int boot_pages)
#endif
args.name = "UMA Zones";
args.size = sizeof(struct uma_zone) +
(sizeof(struct uma_cache) * (mp_maxid));
(sizeof(struct uma_cache) * (mp_maxid + 1));
args.ctor = zone_ctor;
args.dtor = zone_dtor;
args.uminit = zero_init;

View File

@ -311,7 +311,7 @@ struct uma_zone {
* This HAS to be the last item because we adjust the zone size
* based on NCPU and then allocate the space for the zones.
*/
struct uma_cache uz_cpu[1]; /* Per cpu caches */
struct uma_cache uz_cpu[]; /* Per cpu caches */
};
/*