Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Defined a pooled particles from a given length
#4
(09-02-2022, 10:52 AM)lufydad Wrote: But can the number of pooled particles be changed in runtime ?

No. That wouldn't be pooling, would it?

The whole point of a memory pool is to avoid runtime allocation and garbage collection. Allocating memory at runtime is costly, and sets you up for GC. That's why pooling is used as a strategy to create/destroy things at runtime: you create as many "things" (in this case, particles) as you'd possibly need, and just activate/deactivate them at runtime. Changing the size of the pool at runtime would defeat its purpose.
Reply


Messages In This Thread
RE: Defined a pooled particles from a given length - by josemendez - 09-02-2022, 11:35 AM