COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :

Go Back   Cockos Incorporated Forums > Other Software Discussion > WDL users forum

Reply
 
Thread Tools Display Modes
Old 07-18-2015, 06:27 AM   #41
mviljamaa
Human being with feelings
 
Join Date: Jun 2015
Posts: 348
Default

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.
mviljamaa is offline   Reply With Quote
Old 08-14-2015, 03:37 AM   #42
Antonio the carver
Human being with feelings
 
Join Date: Apr 2014
Posts: 42
Default

Quote:
Originally Posted by Xenakios View Post
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
Antonio the carver is offline   Reply With Quote
Old 08-14-2015, 04:03 AM   #43
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
Default

Quote:
Originally Posted by Antonio the carver View Post
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?
Tale is online now   Reply With Quote
Old 08-14-2015, 04:30 AM   #44
Antonio the carver
Human being with feelings
 
Join Date: Apr 2014
Posts: 42
Default

Quote:
Originally Posted by Tale View Post
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.
Antonio the carver is offline   Reply With Quote
Old 08-14-2015, 05:15 AM   #45
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,645
Default

Quote:
Originally Posted by Antonio the carver View Post
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.
Tale is online now   Reply With Quote
Old 08-14-2015, 01:58 PM   #46
Antonio the carver
Human being with feelings
 
Join Date: Apr 2014
Posts: 42
Default

Quote:
Originally Posted by Tale View Post
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
Antonio the carver is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 02:04 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.