On 1/27/16 5:35 PM, Igor wrote:
On Wednesday, 27 January 2016 at 14:31:20 UTC, Steven Schveighoffer wrote:
All D destructors should destroy all the members. And generally
speaking, if you ever plan to use a class with the GC, you should only
destroy non-GC members. The GC members may already b
On Wednesday, 27 January 2016 at 14:31:20 UTC, Steven
Schveighoffer wrote:
On 1/26/16 4:23 PM, Igor wrote:
On Tuesday, 26 January 2016 at 20:17:20 UTC, Steven
Schveighoffer wrote:
[...]
um? Memory manager? I am doing it manually C++ style so I
don't have to
worry about the god forsaken memor
On 1/26/16 4:23 PM, Igor wrote:
On Tuesday, 26 January 2016 at 20:17:20 UTC, Steven Schveighoffer wrote:
On 1/26/16 9:20 AM, Igor wrote:
I have successfully malloc'ed an object but when I go to free it in the
destructor I get an exception. The destructor simply has
~this() // destructor for Fo
On Tuesday, 26 January 2016 at 21:21:29 UTC, Igor wrote:
That shouldn't be the case. I allocate in a static method
called New once. I then deallocate in the destructor. Basically
just as one would do in C++.
You can't deallocate in destructor in C++, because an object can
be embedded in anoth
On Tuesday, 26 January 2016 at 21:23:28 UTC, Igor wrote:
um? Memory manager? I am doing it manually C++ style so I don't
have to worry about the god forsaken memory manager. Why is it
so difficult? I create the object and release it when I need to.
He's talking about *your* memory manager,
On 01/26/2016 01:21 PM, Igor wrote:
> I allocate in a static method called New once. I then deallocate in the
> destructor. Basically just as one would do in C++.
I would never do that in even C++. I don't know any C++ idiom that
warrants 'delete this' where superior alternatives cannot be used
On Tuesday, 26 January 2016 at 21:23:28 UTC, Igor wrote:
On Tuesday, 26 January 2016 at 20:17:20 UTC, Steven
Schveighoffer wrote:
On 1/26/16 9:20 AM, Igor wrote:
[...]
Don't do it in the destructor.
I can only imagine that you are triggering the destructor with
destroy? In this case, destro
On Tuesday, 26 January 2016 at 21:23:28 UTC, Igor wrote:
On Tuesday, 26 January 2016 at 20:17:20 UTC, Steven
Schveighoffer wrote:
On 1/26/16 9:20 AM, Igor wrote:
I have successfully malloc'ed an object but when I go to free
it in the
destructor I get an exception. The destructor simply has
~t
On Tuesday, 26 January 2016 at 19:34:22 UTC, Ali Çehreli wrote:
On 01/26/2016 06:20 AM, Igor wrote:
> I have successfully malloc'ed an object but when I go to free
it in the
> destructor I get an exception. The destructor simply has
>
> ~this() // destructor for Foo
> {
> core.stdc.stdlib.fr
On Tuesday, 26 January 2016 at 20:17:20 UTC, Steven Schveighoffer
wrote:
On 1/26/16 9:20 AM, Igor wrote:
I have successfully malloc'ed an object but when I go to free
it in the
destructor I get an exception. The destructor simply has
~this() // destructor for Foo
{
core.stdc.stdlib.free(&
On 1/26/16 9:20 AM, Igor wrote:
I have successfully malloc'ed an object but when I go to free it in the
destructor I get an exception. The destructor simply has
~this() // destructor for Foo
{
core.stdc.stdlib.free(&this);
}
auto buffer = core.stdc.stdlib.malloc(__traits(classInstanceSize
On 01/26/2016 06:20 AM, Igor wrote:
> I have successfully malloc'ed an object but when I go to free it in the
> destructor I get an exception. The destructor simply has
>
> ~this() // destructor for Foo
> {
> core.stdc.stdlib.free(&this);
> }
That design suggests a complexity regarding objec
On Tuesday, 26 January 2016 at 14:48:48 UTC, Daniel Kozak wrote:
V Tue, 26 Jan 2016 14:20:29 +
Igor via Digitalmars-d-learn
napsáno:
[...]
core.stdc.stdlib.free(cast(void *)this);
I still get an exception:
Exception thrown at 0x7FF6C7CA3700 in test.exe: 0xC005:
Access violati
V Tue, 26 Jan 2016 15:24:00 +
Igor via Digitalmars-d-learn
napsáno:
> On Tuesday, 26 January 2016 at 14:48:48 UTC, Daniel Kozak wrote:
> > V Tue, 26 Jan 2016 14:20:29 +
> > Igor via Digitalmars-d-learn
> > napsáno:
> >
> >> [...]
> >
> > core.stdc.stdlib.free(cast(void *)this);
>
V Tue, 26 Jan 2016 14:20:29 +
Igor via Digitalmars-d-learn
napsáno:
> I have successfully malloc'ed an object but when I go to free it
> in the destructor I get an exception. The destructor simply has
>
> ~this() // destructor for Foo
> {
> core.stdc.stdlib.free(&this);
> }
>
>
> aut
I have successfully malloc'ed an object but when I go to free it
in the destructor I get an exception. The destructor simply has
~this() // destructor for Foo
{
core.stdc.stdlib.free(&this);
}
auto buffer = core.stdc.stdlib.malloc(__traits(classInstanceSize,
App))[0..__traits(classInstanc
16 matches
Mail list logo