Announcement

Collapse
No announcement yet.

PlayOnLinux 5 To Switch From Being Written In Python To Using Java

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #71
    Originally posted by anda_skoa View Post
    Are you sure?

    My understanding was that primitive types used as members, function arguments or local variable were always allocated on the stack.
    And that the heap allocation problem was only triggered by autoboxing, when primitive types need to be passed to methods expecting objects, e.g. generic container.

    Cheers,
    _
    Yes, but there is rarely a way to stack allocate any composite data type (I don't exactly know how far this is possible for CLR value types) except for final classes with all-final members.

    Comment


    • #72
      Originally posted by anda_skoa View Post
      Are you sure?

      My understanding was that primitive types used as members, function arguments or local variable were always allocated on the stack.
      And that the heap allocation problem was only triggered by autoboxing, when primitive types need to be passed to methods expecting objects, e.g. generic container.

      Cheers,
      _
      It's been a while since i used Java, so you're probably right.

      Comment


      • #73
        Originally posted by smitty3268 View Post

        I think it's more that .NET uses the stack with things like ints/structs/etc. rather than forcing even a value of int 0 to be an allocated object from the heap. (Unless java has improved recently?)

        Sorry for jumping at your post (despite having read several other posts which do not seem to state facts), but an int is not allocated on the heap except in one specific case and that is when escape analysis can not be done, i.e. if the int is the member of an object instance, in any other case it's placed on the stack.

        Comment

        Working...
        X