Commit Graph

3 Commits

Author SHA1 Message Date
Zeno-
d176dabeb4 Fix mem leak in mesh cache (#5781) 2017-05-20 08:16:16 +02:00
Loic Blot
582ee15d8e
Fix a memleak pointed by @Zeno- in MeshUpdateQueue
This leak was introduced when added cache to MeshUpdateQueue and only occurs when leaving world.
2017-05-16 08:27:18 +02:00
Perttu Ahola
04cc9de8f2 MeshUpdateQueue: Add a MapBlock cache that minimizes the amount of MapBlock copying done in the main thread
Cache size is configurable by the meshgen_block_cache_size (default 20 MB).

New profiler stats:
- MeshUpdateQueue MapBlock cache hit %
- MeshUpdateQueue MapBlock cache size kB

Removes one type of stutter that was seen on the client when received MapBlocks
were being handled. (the "MeshMakeData::fill" stutter)

Kind of related to at least #5239

Originally preceded by these commits, now includes them:
- Move the mesh generator thread into src/mesh_generator_thread.{cpp,h}
- mesh_generator_thread.cpp: Update code style
- MeshUpdateThread: Modify interface to house a different implementation: Actual functionality will be changed by next commits.
- MeshMakeData: Add fillBlockData() interface (so that caller can fill in stuff from eg. a MapBlock cache)
2017-04-17 14:58:29 +03:00