February 20, 2013 [Issue 5219] @noheap annotation | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=5219 Dicebot <m.strashun@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.strashun@gmail.com --- Comment #10 from Dicebot <m.strashun@gmail.com> 2013-02-20 04:35:14 PST --- Vote up, both this and @nogc. For my embedded experiments I was considering doing a stub version of gc that asserts on every allocation attempts, but more complex projects may still want to use gc for some high-level resource management and being able to cleanly mark the code that is supposed to be free from allocations will help a lot. It makes no sense as a compiler switch or an external tool as this is deeply tied to language semantics and will naturally prohibit usage of plenty of D features that do hidden allocations. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
February 20, 2013 [Issue 5219] @noheap annotation | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=5219 monarchdodra@gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |monarchdodra@gmail.com --- Comment #11 from monarchdodra@gmail.com 2013-02-20 05:35:12 PST --- More than just annotating "no GC" or "no Heap", what would be nice is being able to mark any sections with the same qualifiers as functions. For example, for certain types of touchy cleanup, it would *tremendously* help being able to have a "nothrow" section, which means "while my function can legally throw an exception, I need this specific section to not throw anything, and I need the compiler to enforce this for me". Ditto for "@safe". And, why not, const. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
February 20, 2013 [Issue 5219] @noheap annotation | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=5219 --- Comment #12 from Rob T <alanb@ucora.com> 2013-02-20 09:06:59 PST --- (In reply to comment #11) > More than just annotating "no GC" or "no Heap", what would be nice is being able to mark any sections with the same qualifiers as functions. > > For example, for certain types of touchy cleanup, it would *tremendously* help being able to have a "nothrow" section, which means "while my function can legally throw an exception, I need this specific section to not throw anything, and I need the compiler to enforce this for me". > > Ditto for "@safe". And, why not, const. Yes I agree. This has been brought up before with respect to @trusted since it makes a lot of sense to be able to mark @trusted sections of unsafe code in a @safe function. I have no idea why this was not done by design from the start because it seems too obvious to have been missed. Are there issues with the idea that we don't know about? --rt -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
February 20, 2013 [Issue 5219] @noheap annotation | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=5219 --- Comment #13 from bearophile_hugs@eml.cc 2013-02-20 09:42:39 PST --- (In reply to comment #11) > More than just annotating "no GC" or "no Heap", what would be nice is being able to mark any sections with the same qualifiers as functions. This is an interesting idea, but it's essentially orthogonal to the idea of a @noheap. There was already a discussion about introducing @trusted{...}. So generalizing that idea to all of them isn't a big leap. But it's stuff for a different enhancement request: - - - - - - - - Code section support for @trusted, @safe, pure, nothrow In this thread David Nadlinger has suggested a @trusted" declaration/block: http://forum.dlang.org/thread/blrglebkzhrilxkbprgh@forum.dlang.org if that feature will be introduced, then maybe it's worth introducing a generalization of it, supporting the block syntax for @trusted{}, @safe{}, pure{}, nothrow{}.pure{}, nothrow{}. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
June 30, 2013 [Issue 5219] @noheap annotation | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile_hugs@eml.cc | http://d.puremagic.com/issues/show_bug.cgi?id=5219 Denis Shelomovskij <verylonglogin.reg@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |verylonglogin.reg@gmail.com --- Comment #14 from Denis Shelomovskij <verylonglogin.reg@gmail.com> 2013-06-30 16:56:38 MSD --- One of the good usages of `@noheap` is a class destructor: --- ~this() @noheap; // @noheap for the win! --- -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation