Remove varargs from g_assert and g_assert_not_reachable. (mono/mono#17254)
authorJay Krell <jaykrell@microsoft.com>
Wed, 9 Oct 2019 20:56:06 +0000 (13:56 -0700)
committermonojenkins <jo.shields+jenkins@xamarin.com>
Wed, 9 Oct 2019 20:56:06 +0000 (22:56 +0200)
commit6bfcfa06ca4fda5048d008a0c5854c8dfeff5db1
tree7c88aba6b30fc835c3fc28763c7397b74cbd3458
parentd6b46a38b3e2b487c5bbfc4f8aee67d1f97651aa
Remove varargs from g_assert and g_assert_not_reachable. (mono/mono#17254)

Remove varargs from g_assert and g_assert_not_reachable (save 200+ bytes per frame in wasm interp).

g_assertf unchanged.

I have a strong suspicion, this will save approximately 432 - sizeof (InterpFrame) bytes of stack
per function call in the WebAssembly interpreter.

It will not significantly benefit or hurt any other system.
Systems with disabled asserts will receive a small size improvement.

WebAssembly has no provision for varargs.
Emscripten emulates it.
It appears the emulation allocates room in the frame per outgoing varargs call.
No stack packing.
So each g_assert takes space.

Alternative would be to discourage or disable or remove asserts.

Commit migrated from https://github.com/mono/mono/commit/8718b75b7a89f04e2423d11a009f11b37ef802df
src/mono/mono/eglib/glib.h
src/mono/mono/eglib/goutput.c