Re: try/catch in scsynth

[email protected]
Newsgroups gmane.comp.audio.supercollider.devel
Message-ID <[email protected]>
On March 29, 2018 18:50:20 miguel.negrao-lists-/wLt9BB+Iy41Tgt60Rntydi2O/[email protected] wrote:

> It looks though that the try/catch was written by James McCartney which
> I imagine knows what he was doing... ?
> https://github.com/supercollider/supercollider/blob/66f84c8d57e3947df95e2b2eb72f248ef1cfb338/source/server/SC_CoreAudio.cpp#L927
>
> grepping the plugins directory I don't find any throw statements there
> though...

If there's no try/catch, then failure to allocate memory in any plug-in 
means the server would crash abruptly, without any sort of informative 
message to the user. It's not really optional here. (It's not necessary for 
plug-in code to throw exceptions intentionally for try/catch to be 
meaningful. And plug-ins I think should pretty obviously avoid using 
exceptions for routine flow-of-control.)

I guess, if try/catch were bad for performance in the absence of any 
exceptions, we would have heard many many complaints by now. And, if you do 
have exceptions (e.g. out of memory), you have bigger problems than an 
audio dropout.

hjh

Sent with AquaMail for Android
http://www.aqua-mail.com




_______________________________________________
sc-dev mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: http://www.listarc.bham.ac.uk/marchives/sc-dev/
search: http://www.listarc.bham.ac.uk/lists/sc-dev/search/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.