Comments (3)
I had a similar issue with the Music object and I'm realizing that having a stay_resident flag isn't going to really solve the issue and is a non-elegant solution to the problem.
The real solution is to also store a pointer to the raw data along with the reference counting so that copied objects can gain access to the data in said pointer. This way only one copy of the raw data is ever loaded and stays resident until all references are released after which the raw data is finally deallocated.
from nas2d-core.
I had a similar issue with the Music object and I'm realizing that having a stay_resident flag isn't going to really solve the issue and is a non-elegant solution to the problem.
The real solution is to also store a pointer to the raw data along with the reference counting so that copied objects can gain access to the data in said pointer. This way only one copy of the raw data is ever loaded and stays resident until all references are released after which the raw data is finally deallocated.
from nas2d-core.
Killing this idea, no longer a need. All images keep their pixel data resident but they now only keep one copy of the pixel data no matter how many times it's loaded.
from nas2d-core.
Related Issues (20)
- Refactor Rectangle::translate to modify the rectangle in-place instead of returning a copy HOT 1
- Cross platform builds with Clang
- Update `Delegate` and `Signal` for lambdas HOT 5
- Arch Linux compile error HOT 2
- Remove `argv_0` from `Filesystem` constructor
- Fix test-graphics `uniform_int_distribution` template parameter HOT 1
- Update MacOS build image HOT 1
- Re-evaluate MacOS support...? HOT 5
- Use config specific intermediate folders with `make` HOT 1
- Refactor MSVC project files HOT 1
- Fix debug builds of unit test project HOT 4
- Re-introduced audio bug HOT 4
- Fix `vcpkg` caching on CI HOT 1
- Remove Resource names HOT 1
- Remove Doxygen comments on private class fields HOT 1
- Improve `makefile` project semantics HOT 3
- Use Response Files for `make` builds
- Pulled latest, vcpkg fails to build HOT 2
- `EventHandler` key modifier checks should be `static`
- Update Build Images
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nas2d-core.