Re: GC operates in LIFO sequence?

2017-09-24 Thread Joseph5 via Digitalmars-d

Hmmm. Find some useful information here.


Re: GC operates in LIFO sequence?

2017-08-10 Thread Guillaume Piolat via Digitalmars-d

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).


Re: GC operates in LIFO sequence?

2017-08-09 Thread Johnson Jones via Digitalmars-d

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!




Re: GC operates in LIFO sequence?

2017-08-09 Thread 12345swordy via Digitalmars-d

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


Re: GC operates in LIFO sequence?

2017-08-09 Thread Meta via Digitalmars-d

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.


Re: GC operates in LIFO sequence?

2017-08-09 Thread Swoorup Joshi via Digitalmars-d
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?


Re: GC operates in LIFO sequence?

2017-08-09 Thread Guillaume Piolat via Digitalmars-d

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


Re: GC operates in LIFO sequence?

2017-08-09 Thread Adam D. Ruppe via Digitalmars-d

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...




GC operates in LIFO sequence?

2017-08-09 Thread MGW via Digitalmars-d
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.