Comments (10)
Ah... Yes of course; The cache is global and there's no lock on it.
This means that VPR_CACHE should not be defined by default. It should only be defined when one is sure that only one thread, at a time, will use VPR.
I will probably end up completely removing all the VPR_CACHE stuff since it didn't really provide the performance improvements I had hoped for.
from graphics32.
I'll probably need a reproducible test case if I'm to anything about this. As you can see from the try...except
you are not the first to get an overflow there.
from graphics32.
This try-except block is mine.
from graphics32.
Ah :-) but still; Not the first.
from graphics32.
Undefining VPR_CACHE
in GR32_VPR.pas fixes the issue. Is there something wrong with RenderPolyPolygon?
from graphics32.
@zedxxx Did you delete a comment?
Is everything right here? https://github.com/graphics32/graphics32/blob/master/Source/GR32_VPR.pas#L579
Yes, as far as I can see it's okay - but I should have commented the code. It increases the allocated size in blocks of GrowSpanDataCacheSize
.
graphics32/Source/GR32_VPR.pas
Lines 574 to 582 in 13c296e
from graphics32.
Yes, I realized that this is not the case.
BTW, GetMem on line 581 needs to be replaced with ReallocMem. Right?
from graphics32.
BTW, GetMem on line 581 needs to be replaced with ReallocMem. Right?
Yes. You are right.
from graphics32.
Oh, its multi-threading problem (application use background threads to render bitmaps).
After replacing var
with threadvar
for global variables all works fine, but I'm not sure about the memory leaks.
Perhaps using TCriticalSection
is the best solution here.
from graphics32.
Perhaps using TCriticalSection is the best solution here.
No because it's not only the allocation and reallocation that needs to be protected. It's also the content of the buffer. Only one rasterizer at a time can use the buffer, and locking the buffer while one thread is using it would effectively serialize rasterization.
from graphics32.
Related Issues (20)
- Repaint Optimizer "forgets" to update the bitmap HOT 2
- Repaint Optimizer "forgets" to update the bitmap 2 HOT 7
- Polygon grow using Clipper2 very very slow HOT 43
- Delphi 12 incompatibility HOT 1
- Polygon draw result looks strange HOT 18
- GR32_LowLevel.Mirror PUREPASCAL does not produce expected values HOT 11
- Revive jsRoundEx? HOT 1
- Lazarus design time support broken HOT 21
- TBitmap32.Textout interesting behavior HOT 12
- PNG support broken on 32-bit FPC HOT 4
- LF Line Endings in the .DPKs Cause File Corruption HOT 18
- Access Violation with color picker controls on Lazarus HOT 2
- BuildPolyLine produces concave curves that are unsuitable for polylines HOT 13
- TColorPickerGTK not displayed correctely after copy/paste HOT 4
- NeoLemmix / SuperLemmix pull request
- Commit "Fix for AV with tiled draw" breaks my code HOT 7
- Bug with layes visibility change HOT 15
- Repaint TCustomLayer and draw TBitmapLayer at the same time HOT 13
- TGaussianKernel is broken HOT 1
- GAMMA_ENCODING_TABLE mayhem HOT 1
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 graphics32.