#assert(size_of(Entity) > 512, "INFO: 32MB @ 2^12 entities.")
#assert(size_of(Entity) < 768, "INFO: 48MB @ 2^12 entities.")
#assert(size_of(Entity) < 1024, "INFO: 64MB @ 2^12 entities.")
#assert(size_of(Globals) > 32*Megabyte, "INFO: Know this figure.")
#assert(size_of(Globals) < 64*Megabyte, "INFO: Know this figure.")
#assert(size_of(Globals) < 128*Megabyte, "INFO: Know this figure.")
I’m curious if others do this, and how you approach it.
Note that the first case is a > to ensure I couldn’t possibly shrink the structure below the last known (roughly) power of two.
The only unfortunate thing about this scheme is that I’ve managed to get in a situation where a struct can shrink on one platform and not others. For that reason, I think I’d just rather have a warning, but I’m not aware of a way to emit warnings.
Do do you do anything to stay mindful of related things?