+/* --- @sod__chksz_fail@ --- *
+ *
+ * Arguments: @const SodClass *cls@ = class we were trying to instantiate
+ * @size_t sz@ = size allocated
+ *
+ * Returns: Doesn't.
+ *
+ * Use: Reports instantiation failure caused by a mismatch between
+ * the size allocated (@sz@) and the size required for an
+ * instance of class @cls@.
+ */
+
+SOD__NORETURN void sod__chksz_fail(const SodClass *cls, size_t sz)
+{
+ fprintf(stderr, "INTERNAL ERROR: size mismatch for class `%s': "
+ "%"PRIuSZ" allocated but %"PRIuSZ" required",
+ cls->cls.name, PRINT_SZ(sz), PRINT_SZ(cls->cls.initsz));
+ abort();
+}
+