|
07-18-2015, 06:27 AM
|
#41
|
Human being with feelings
Join Date: Jun 2015
Posts: 348
|
BTW, the same exact problem occurs in IPlugGamma ( https://github.com/olilarkin/IPlugGamma). So I guess this is some "feature"?
Oli could probably clarify, whether this really is the intended behavior.
|
|
|
08-14-2015, 03:37 AM
|
#42
|
Human being with feelings
Join Date: Apr 2014
Posts: 42
|
Quote:
Originally Posted by Xenakios
Hmm, well without seeing your code that put the double*'s into the std::queue I can't determine if what you were attempting was correct to begin with. It might have seemed to work just by luck.
The WDL_FastQueue works so that you put stuff into it with Add. With Available you can check how much stuff the queue has. When you have enough, you can copy elements to a destination buffer with GetToBuf. Then you need to use Advance to advance the queue the same amount you copied into the destination. (GetToBuf by itself won't advance the queue.)
|
Does Advance() also clear the queue, or should Clear() be used for that? I could probably find out by trial and error, but I got some pretty insane leaks, so I wanted to to ask hear first, before torturing my pc again
|
|
|
08-14-2015, 04:03 AM
|
#43
|
Human being with feelings
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,646
|
Quote:
Originally Posted by Antonio the carver
Does Advance() also clear the queue, or should Clear() be used for that? I could probably find out by trial and error, but I got some pretty insane leaks, so I wanted to to ask hear first, before torturing my pc again
|
Well, if Available() returns 100, and you do Advance(10), then after that Available() will return 90. But if you do Clear(), then Available() will always return 0. Does that answer your question?
|
|
|
08-14-2015, 04:30 AM
|
#44
|
Human being with feelings
Join Date: Apr 2014
Posts: 42
|
Quote:
Originally Posted by Tale
Well, if Available() returns 100, and you do Advance(10), then after that Available() will return 90. But if you do Clear(), then Available() will always return 0. Does that answer your question?
|
Definitely, yes. Clear and to the point! So, basically, WDL_FastQueue takes care of freeing up memory both with Advance() and Clear()? Which should mean that if leaks occur it is likely because these methods are not called as often as they should, thus growing the buffer uncontrollably?
Obviously this depends on the specific case. I realize that these questions might be a little naive, but since I'm not the brightest programmer in town, I want to get a solid grip on how FastQueue works.
|
|
|
08-14-2015, 05:15 AM
|
#45
|
Human being with feelings
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,646
|
Quote:
Originally Posted by Antonio the carver
So, basically, WDL_FastQueue takes care of freeing up memory both with Advance() and Clear()? Which should mean that if leaks occur it is likely because these methods are not called as often as they should, thus growing the buffer uncontrollably?
|
Yes, exactly.
BTW, WDL_FastQueue also has the option to keep unused buffers around, so they can be reused, but even then they are still managed by WDL_FastQueue.
|
|
|
08-14-2015, 01:58 PM
|
#46
|
Human being with feelings
Join Date: Apr 2014
Posts: 42
|
Quote:
Originally Posted by Tale
Yes, exactly.
BTW, WDL_FastQueue also has the option to keep unused buffers around, so they can be reused, but even then they are still managed by WDL_FastQueue.
|
Thank you for your patience, Tale. Your help has been very useful! I finally solved the issues with leaks, and now my plug-in doesn't hog 3.5 gigabyte of ram anymore XD
Cheers
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 01:57 AM.
|