Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Creating a new List<Vector3> crashes without any info

Discussion in 'iOS and tvOS' started by Zita, Feb 22, 2015.

  1. Zita

    Zita

    Joined:
    Oct 24, 2014
    Posts:
    17
    I have spent days debugging all sorts of AOT/JIT-related problems when trying to run my Unity-app on iPad. But now I have got stuck on a really strange problem. I'm just trying to instatiate a new List<Vector3> from a Vector3-array like this:

    List<Vector3> temp = new List<Vector3>(new Vector3[] { new Vector3(1, 1, 1), new Vector3(2, 2, 2), new Vector3(3, 3, 3 });

    And it all crashes and burn. "Xcode quit unexpectedly" is all I get.

    Is this a known problem? That nothing seem to work on iOS? Ghhhh
     
  2. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    1,272
    List<Vector3> temp = new List<Vector3>() { new Vector3(1, 1, 1), new Vector3(2, 2, 2), new Vector3(3, 3, 3) } ;
     
  3. Zita

    Zita

    Joined:
    Oct 24, 2014
    Posts:
    17
    It should work anyway (my example was just to show that I used an Array as input to a List)

    But I found out what the problem was! It all worked fine when I isolated this code in a new app. And then I learned about the f*****g trampolines! Oh my gooood! Im so happy now but also extremely tired and frustrated that this took so long to debug! Why oh why couldn't Xcode give me a hint instead of just crashing. And why couldn't Unity alert me about this important detail!

    The default trampolines (I have no idea what they are really) are by default set low to not take up unessesary memory. But if you use a lot of generics I have read somewhere that you need to increase the trampolines! I did and now it's working without crashing! Halleluja! I was on the brink of insanity! Maybee I have got spoiled with developing in VS/C# for so long =)
     
    r618 likes this.
  4. r618

    r618

    Joined:
    Jan 19, 2009
    Posts:
    1,272
    I've just omitted the array definition in the hope that is helps AOT compiler and possibly produces cleaner/correct code.
    I'm glad that you found out about trampolines and that it actually helped.