Skip to content

Instantly share code, notes, and snippets.

@tosik
Created April 5, 2017 01:55
Show Gist options
  • Save tosik/0fca151ac58ed37cdb08437133824352 to your computer and use it in GitHub Desktop.
Save tosik/0fca151ac58ed37cdb08437133824352 to your computer and use it in GitHub Desktop.
class A {}
struct B {}

class Main
{
  public static void Foo()
  {
    new A();
    new B();
  }
}

を変換すると↓みたいに(抜粋)なる

	B_t3938918186  V_0;
	memset(&V_0, 0, sizeof(V_0));
	{
		A_t3938918183 * L_0 = (A_t3938918183 *)il2cpp_codegen_object_new(A_t3938918183_il2cpp_TypeInfo_var);
		A__ctor_m4003197151(L_0, /*hidden argument*/NULL);
		Initobj (B_t3938918186_il2cpp_TypeInfo_var, (&V_0));
		return;
	}

new B() はちゃんとスタックメモリに乗る。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment