On Friday, 5 September 2014 at 06:43:56 UTC, monarch_dodra wrote:
On Sunday, 24 August 2014 at 09:29:53 UTC, Jacob Carlborg wrote:
On 2014-08-24 10:03, Bienlein wrote:
I have omitted the code for the TestClass class to save
space. Problem
is that the compiler outputs this:
Error: @nogc funct
On Sunday, 24 August 2014 at 09:29:53 UTC, Jacob Carlborg wrote:
On 2014-08-24 10:03, Bienlein wrote:
I have omitted the code for the TestClass class to save space.
Problem
is that the compiler outputs this:
Error: @nogc function 'main.nogcNew!(TestClass, ).nogcNew'
cannot call
non-@nogc fu
On 04/09/14 22:30, Kagamin wrote:
emplace calls constructor, and constructor can't be realistically
required to be nogc. It depends on the constructor. Similar for destroy.
But if the constructor is @nogc or if there's a default constructor.
--
/Jacob Carlborg
On Sunday, 24 August 2014 at 08:03:11 UTC, Bienlein wrote:
Hello,
I was having a look at the new nogc annotation and therefore
wrote some code that creates an instance on the heap bypassing
the GC (code adapted from http://dpaste.dzfl.pl/2377217c7870).
Problem is that calls to call the class'
On Sunday, 24 August 2014 at 13:27:01 UTC, Jacob Carlborg wrote:
On 2014-08-24 14:18, Kagamin wrote:
Shouldn't emplace and destroy infer their attributes instead
of strictly
annotating them as nogc.
If they are templates, I guess they should. I don't know how
good the compiler is at inferri
On 2014-08-24 14:18, Kagamin wrote:
Shouldn't emplace and destroy infer their attributes instead of strictly
annotating them as nogc.
If they are templates, I guess they should. I don't know how good the
compiler is at inferring attributes. I also haven't looked at the source
code for these
On Sunday, 24 August 2014 at 09:29:53 UTC, Jacob Carlborg wrote:
On 2014-08-24 10:03, Bienlein wrote:
I have omitted the code for the TestClass class to save space.
Problem
is that the compiler outputs this:
Error: @nogc function 'main.nogcNew!(TestClass, ).nogcNew'
cannot call
non-@nogc fu
Bienlein:
@nogc is meant mostly for stack-allocation.
Ah, I missed that. Thanks for telling me.
@nogc is also for allocation from the C heap, despite this is
less common :-)
Bye,
bearophile
On Sunday, 24 August 2014 at 08:48:03 UTC, bearophile wrote:
Bienlein:
things in such Limbo for several years).
decades
On 2014-08-24 10:03, Bienlein wrote:
I have omitted the code for the TestClass class to save space. Problem
is that the compiler outputs this:
Error: @nogc function 'main.nogcNew!(TestClass, ).nogcNew' cannot call
non-@nogc function 'core.exception.onOutOfMemoryError'
Error: @nogc function 'mai
On Sunday, 24 August 2014 at 08:48:03 UTC, bearophile wrote:
Perhaps there are ways, but note that @nogc is meant mostly for
stack-allocation.
Ah, I missed that. Thanks for telling me. I changed nogcDel now
to null out the deallocated object:
void nogcDel(T)(ref T obj)
{
import core.std
Bienlein:
Is there a way to get around this?
Perhaps there are ways, but note that @nogc is meant mostly for
stack-allocation.
In general when in D you have to write lot of hairy code to do
something, it means that in most cases you shouldn't do that
something.
When calling delete t the
Hello,
I was having a look at the new nogc annotation and therefore
wrote some code that creates an instance on the heap bypassing
the GC (code adapted from http://dpaste.dzfl.pl/2377217c7870).
Problem is that calls to call the class' constructor, destructor
and others can't be called anymore
13 matches
Mail list logo