Hacker News new | ask | show | jobs
by danbolt 2231 days ago
Phaser 3 (and its predecessor Phaser 2) provide helper code for managing object pools[1]. I can imagine any non-toy project takes advantage of pooling for speed when it can.

[1] https://photonstorm.github.io/phaser3-docs/Phaser.GameObject...

1 comments

You should do this in both GC'd and non-GC'd languages. Obviously C/C++/etc give you more options for arenas and the like. If you have a well bounded upper limit there's a while lot of good reasons to preallocate(locality of data, GC pressure, etc).

Some engines I used to work with would assert() on malloc/free if it happened outside certain safe regions of execution.