Announcement

Collapse
No announcement yet.

TInlineAllocator can't be Uproperty() so my array is garbage collected ?

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

    TInlineAllocator can't be Uproperty() so my array is garbage collected ?

    Dear all,

    In a prototype i'm building I use an array of type:

    TArray<UFZ_Cell*, TInlineAllocator<100000>> Cells;

    The TInlineAllocator keyword allows me to create these cells on the stack (in an attempt to improve performance). The problem is that my array is being garbage collected because i can't make stack allocated TArray's UPROPERTY(). This also goes for TFixedAllocator. How can i manage this?

    Thanks a million!

    Move information on stack allocated TArray's:
    https://www.unrealengine.com/en-US/b...or-performance

    #2
    Did you try something like, maybe:
    Code:
    TStaticArray< TSharedPtr<UFZ_Cell>, TInlineAllocator<100000> > Cells;
    ?
    | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

    Comment


      #3
      Euhm that doesn't seem to compile:

      error C2993: 'TInlineAllocator<100000,FDefaultAllocator>': illegal type for non-type template parameter 'NumElements'

      Would that allow me to make it UPROPERTY()? Or would that prevent garbage collection from throwing away my data?

      Comment

      Working...
      X