digitalmars.D - GC operates in LIFO sequence?
- MGW (10/10) Aug 09 2017 Memory allocation and deallocation when an application is being
- Adam D. Ruppe (5/7) Aug 09 2017 Not really, it operates in an undefined sequence... just whenever
- Guillaume Piolat (2/12) Aug 09 2017 https://p0nce.github.io/d-idioms/#The-trouble-with-class-destructors
- Swoorup Joshi (3/16) Aug 09 2017 Is garbage collection even useful besides managing memory?
- Meta (2/3) Aug 09 2017 Managing memory is GC's raison d'ĂȘtre.
- 12345swordy (4/21) Aug 09 2017 That is like saying "Is fire even useful besides heating things
- Johnson Jones (3/20) Aug 09 2017 Of course! Once a week it is useful! Else things start piling up
- Guillaume Piolat (4/5) Aug 10 2017 GC has the unique advantage of being a global owner, hence
- Joseph5 (1/1) Sep 24 2017 Hmmm. Find some useful information here.
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.
Aug 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...
Aug 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
Aug 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:Is garbage collection even useful besides managing memory?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
Aug 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.
Aug 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:That is like saying "Is fire even useful besides heating things up?". AlexOn Wednesday, 9 August 2017 at 13:46:29 UTC, MGW wrote:Is garbage collection even useful besides managing memory?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
Aug 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:Of course! Once a week it is useful! Else things start piling up and getting really smelly! Not very healthy!On Wednesday, 9 August 2017 at 13:46:29 UTC, MGW wrote:Is garbage collection even useful besides managing memory?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
Aug 09 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).
Aug 10 2017