you are viewing a single comment's thread
view the rest of the comments
[–] 12 points 3 years ago (1 child)

This bit made me laugh the most:

The TerrariaClone.init() method, which is over 1,300 lines long, actually grew so large that it hit the limit hardcoded into the Java compiler for the maximum memory that can be taken up by a single function! The solution? Copy half of the init() code into a new method, called codeTooLarge(), and call that from init().

  • source
  • parent
  • hideshow 1 child comment
  • [–] 2 points 2 years ago

    Is that really true? I swear I've seen java codebases with methods thousands of lines long. What can possibly overflow in such a small amount of code?

    The only thing that sounds possible to me is a value stored as a u8 or u16 in the bytecode format, with the assumption that methods are never very big, but that would still be surprising given that it's a stack based VM.

  • source
  • parent