Possibly refactor CACHED_CONTAINER
Bug #1481108 reported by
Simon Richter
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
KiCad |
Won't Fix
|
Wishlist
|
Simon Richter |
Bug Description
This appears to be a reimplementation of std::vector, for the most part.
* Why does it exist?
* Can it be removed?
To post a comment you must log in.
What is needed here is a capability to store continuous chunks of data (of various size, as every item may have a different demand), effectively creating a one big continuous block of memory that can be easily transferred to the GPU memory.
Now when I think about the code, perhaps we could replace the raw pointer (VERTEX_ CONTAINER: :m_vertices) with a std::vector. CACHED_CONTAINER keeps a list of free memory chunks that can be quickly used without frequent memcpying. I am not sure if it can be done automatically with std::vector, so I would rather keep that part in place.
If you can come up with a more efficient implementation, or just an idea how to improve speed - I will eagerly apply your suggestions.