Possibly refactor CACHED_CONTAINER

Bug #1481108 reported by Simon Richter
8
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?

Revision history for this message
Maciej Suminski (orsonmmz) wrote :

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.

Revision history for this message
Simon Richter (sjr) wrote : Re: [Bug 1481108] Re: Possibly refactor CACHED_CONTAINER

Hi,

On 04.08.2015 09:54, Maciej Sumiński wrote:

> If you can come up with a more efficient implementation, or just an idea
> how to improve speed - I will eagerly apply your suggestions.

Sure, just won't happen before the release, as I'm quite busy --
that's why I made myself a bug report.

The only reason I stumbled across this code was the log2() call in the
grow function.

   Simon

Revision history for this message
Maciej Suminski (orsonmmz) wrote :

The report is not valid anymore. Current CACHED_CONTAINER implementation manages mapped video memory, which cannot be easily replaced with std::vector.

Changed in kicad:
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.