For pool registrations that are created from the type declaration, we
now have the ability to verify that the requested alignment matches
the type's one. Let's not miss this opportunity, as we've met bugs in
the past that were caused by such mismatches. The principle is simple:
if the type alignment is known, we check that the configured alignment
is at least as large as that one otherwise we refuse to start (since
the code may crash at any moment). Obviously it doesn't crash for now!
alignment++;
}
+ if (reg->type_align && alignment < reg->type_align) {
+ ha_alert("BUG in the code: at %s:%u, requested creation of pool '%s' aligned to %u "
+ "while type requires alignment of %u! Please report to developers. Aborting.\n",
+ reg->file, reg->line, name, alignment, reg->type_align);
+ return NULL;
+ }
+
extra_mark = (pool_debugging & POOL_DBG_TAG) ? POOL_EXTRA_MARK : 0;
extra_caller = (pool_debugging & POOL_DBG_CALLER) ? POOL_EXTRA_CALLER : 0;
extra = extra_mark + extra_caller;