It would be nice to be able to invalidate objects that should no longer be used. The API could be similar to `free()` in C, but it should also allow individual fields to be invalidated. For some types of objects it can actually be done without additional meta-data (but it would still be checked at time of access, unless a GC run happens): * short/int/long (that are not signed/unsigned) * integers that don't use the full unsigned/singed range. * non-nullable objects. * references (if the platform doesn't use the full address space, so there's room for a sentinel value such as `(void *)-1`) * bool * padding in structs (assuming that it is required to be 0) I.e. all except for the following types (and only when there's no alignment padding): * byte * unsigned (short/int/long) * signed (short/int/long) Object invalidation for "all-bits-used" types --------------------------------------------- How to support invalidation of the "all-bits-used" types, i.e. full-range byte/unsigned/signed. Solution 1: A small metadata bit flag could be inserted: struct Thing { unsigned char _SLUL_infobyte; unsigned long l1; unsigned long l2; } Solution 2: Track uninitialized data in each arena chunk? Solution 3: Track all "all-bits-used" types in each arena chunk? Related: "Uninitialized" and Sentinel values -------------------------------------------- It would actually be quite nice to have 2 different values: * Invalidated (including uninitialized) * `none` Note that `none` is trickier, because a struct can be none, but its fields can also be none. And structs can be nested.