Add size validation to PIKE_MAP_VARIABLE() et al when PIKE_DEBUG
Adjust the API for quick_map_variable()
to take the size of the mapped item as one of the arguments, so that the size can be validated.
It is easy to make mistakes with PIKE_MAP_VARIABLE()
that are only visible on some architectures. Eg:
struct foo_storage {
INT32 bar; /* BUG: Ought to be INT_TYPE. */
};
...
{
PIKE_MAP_VARIABLE("bar", OFFSETOF(foo_storage, bar), tInt, T_INT, 0);
}
The above code will work fine on ILP32 (where INT_TYPE == INT32), but break (in hard to detect ways) on LP64 (where INT_TYPE == INT64).