Thread overview
GC operates in LIFO sequence?
Aug 09, 2017
MGW
Aug 09, 2017
Adam D. Ruppe
Aug 09, 2017
Guillaume Piolat
Aug 09, 2017
Swoorup Joshi
Aug 09, 2017
Meta
Aug 09, 2017
12345swordy
Aug 09, 2017
Johnson Jones
Aug 10, 2017
Guillaume Piolat
Sep 24, 2017
Joseph5
August 09, 2017
Memory allocation and deallocation when an application is being completed in GC operates in FIFO sequence.
Is there a possibility to shift GC memory deallocation to LIFO mode?

It`s connected with the fact that GUI library (Qt) creates QApplication first,
but GC destroys this object first when an application is being completed. This leads to the application failure.
If the sequence of memory deallocation on LIFO is shifted, it will essentially simplify the cooperation with C++ libraries.

August 09, 2017
On Wednesday, 9 August 2017 at 13:46:29 UTC, MGW wrote:
> Memory allocation and deallocation when an application is being completed in GC operates in FIFO sequence.

Not really, it operates in an undefined sequence... just whenever it gets around to it in scans.

If destruction order is important, you should use RAII or explicit destruction...

August 09, 2017
On Wednesday, 9 August 2017 at 13:46:29 UTC, MGW wrote:
> Memory allocation and deallocation when an application is being completed in GC operates in FIFO sequence.
> Is there a possibility to shift GC memory deallocation to LIFO mode?
>
> It`s connected with the fact that GUI library (Qt) creates QApplication first,
> but GC destroys this object first when an application is being completed. This leads to the application failure.
> If the sequence of memory deallocation on LIFO is shifted, it will essentially simplify the cooperation with C++ libraries.

https://p0nce.github.io/d-idioms/#The-trouble-with-class-destructors
August 09, 2017
On Wednesday, 9 August 2017 at 15:47:17 UTC, Guillaume Piolat wrote:
> On Wednesday, 9 August 2017 at 13:46:29 UTC, MGW wrote:
>> Memory allocation and deallocation when an application is being completed in GC operates in FIFO sequence.
>> Is there a possibility to shift GC memory deallocation to LIFO mode?
>>
>> It`s connected with the fact that GUI library (Qt) creates QApplication first,
>> but GC destroys this object first when an application is being completed. This leads to the application failure.
>> If the sequence of memory deallocation on LIFO is shifted, it will essentially simplify the cooperation with C++ libraries.
>
> https://p0nce.github.io/d-idioms/#The-trouble-with-class-destructors

Is garbage collection even useful besides managing memory?
August 09, 2017
On Wednesday, 9 August 2017 at 17:38:15 UTC, Swoorup Joshi wrote:
> Is garbage collection even useful besides managing memory?

Managing memory is GC's raison d'ĂȘtre.
August 09, 2017
On Wednesday, 9 August 2017 at 17:38:15 UTC, Swoorup Joshi wrote:
> On Wednesday, 9 August 2017 at 15:47:17 UTC, Guillaume Piolat wrote:
>> On Wednesday, 9 August 2017 at 13:46:29 UTC, MGW wrote:
>>> Memory allocation and deallocation when an application is being completed in GC operates in FIFO sequence.
>>> Is there a possibility to shift GC memory deallocation to LIFO mode?
>>>
>>> It`s connected with the fact that GUI library (Qt) creates QApplication first,
>>> but GC destroys this object first when an application is being completed. This leads to the application failure.
>>> If the sequence of memory deallocation on LIFO is shifted, it will essentially simplify the cooperation with C++ libraries.
>>
>> https://p0nce.github.io/d-idioms/#The-trouble-with-class-destructors
>
> Is garbage collection even useful besides managing memory?

That is like saying "Is fire even useful besides heating things up?".

Alex
August 09, 2017
On Wednesday, 9 August 2017 at 17:38:15 UTC, Swoorup Joshi wrote:
> On Wednesday, 9 August 2017 at 15:47:17 UTC, Guillaume Piolat wrote:
>> On Wednesday, 9 August 2017 at 13:46:29 UTC, MGW wrote:
>>> Memory allocation and deallocation when an application is being completed in GC operates in FIFO sequence.
>>> Is there a possibility to shift GC memory deallocation to LIFO mode?
>>>
>>> It`s connected with the fact that GUI library (Qt) creates QApplication first,
>>> but GC destroys this object first when an application is being completed. This leads to the application failure.
>>> If the sequence of memory deallocation on LIFO is shifted, it will essentially simplify the cooperation with C++ libraries.
>>
>> https://p0nce.github.io/d-idioms/#The-trouble-with-class-destructors
>
> Is garbage collection even useful besides managing memory?

Of course! Once a week it is useful! Else things start piling up and getting really smelly! Not very healthy!

August 10, 2017
On Wednesday, 9 August 2017 at 17:38:15 UTC, Swoorup Joshi wrote:
>
> Is garbage collection even useful besides managing memory?

GC has the unique advantage of being a global owner, hence avoiding to encode ownership into types for memory (when you can use it).
September 24, 2017
Hmmm. Find some useful information here.