View previous topic :: View next topic |
Author |
Message |
Ant
Joined: 06 Mar 2004 Posts: 306 Location: Canada
|
Posted: Mon May 30, 2005 9:09 am Post subject: dynDUI delay |
|
|
Debuging the new dynDUI shows to be more problematic than expected.
Seems that structs created by the D code and passed to Gtk+ (TreeIter) are collected by the D GC - as expected but that should be be a problem also on the old DUI version and it isn't(?).
The problem gets more interesting because the structs can be used i.e.
the tree can be browsed. We get into problems only when the tree is refreshed by removing all nodes.
This problem manifests on leds code outline view - but not on all source files.
Just to let you know what's going on...
Antonio |
|
Back to top |
|
|
JJR
Joined: 22 Feb 2004 Posts: 1104
|
Posted: Mon May 30, 2005 10:19 am Post subject: |
|
|
Very, strange! I hope it's not too difficult to fix.
Good to know, though. Is that the last remaining issue?
-JJR |
|
Back to top |
|
|
popatr
Joined: 20 May 2005 Posts: 3
|
Posted: Wed Jun 01, 2005 11:23 am Post subject: |
|
|
I'm no d expert by any stretch, but I know that d classes can have custom garbage collection behavior. I.e., you can specify that a class not be garbage collected... in which case you need to manage the memory yourself. There's some piece of code on digital mars which shows this.
So, if garbage collection is the problem, this may be the solution. |
|
Back to top |
|
|
JJR
Joined: 22 Feb 2004 Posts: 1104
|
Posted: Wed Jun 01, 2005 11:53 am Post subject: Re: dynDUI delay |
|
|
Ant wrote: | Seems that structs created by the D code and passed to Gtk+ (TreeIter) are collected by the D GC - as expected but that should be be a problem also on the old DUI version and it isn't(?).
|
It might have been a problem with the old version, but we likely never noticed it. Remember that leds was not near as far along on windows as before. And on linux, access violations/segmentation faults don't occur in the same situations as on win32.
Quote: | The problem gets more interesting because the structs can be used i.e.
the tree can be browsed. We get into problems only when the tree is refreshed by removing all nodes.
This problem manifests on leds code outline view - but not on all source files.
|
Are you working with windows or linux? So it's the tree view that's still causing problems?
-JJR |
|
Back to top |
|
|
Ant
Joined: 06 Mar 2004 Posts: 306 Location: Canada
|
Posted: Wed Jun 01, 2005 12:07 pm Post subject: Re: dynDUI delay |
|
|
JJR wrote: |
Are you working with windows or linux? So it's the tree view that's still causing problems?
-JJR |
I'm on linux.
I made some updates to the svn.
Try to fire leds (go to preferences and set code browser to display, restart leds) and open the DUI.def.types, it will segfault (but maybe you need to open another source file after the types).
I think the problem is that the treeNodes are linked on the Gtk+ C code but not on the D side so the GC collects the tree nodes.
Adding a root to the GC might fix that - I believe I did that on the base widget but the treeNode (i.e. TreeIter) is not a widget.
I have to try it.
Ant |
|
Back to top |
|
|
JJR
Joined: 22 Feb 2004 Posts: 1104
|
Posted: Wed Jun 01, 2005 12:13 pm Post subject: |
|
|
Ouch! That's a very subtle issue. I would not have found the source of that bug. I haven't dealt with the GC on that level before.
I hope that's the source of the problem.
I'll try compiling.
-JJR |
|
Back to top |
|
|
Ant
Joined: 06 Mar 2004 Posts: 306 Location: Canada
|
Posted: Wed Jun 01, 2005 12:49 pm Post subject: |
|
|
JJR wrote: | Ouch! That's a very subtle issue. I would not have found the source of that bug. I haven't dealt with the GC on that level before.
I hope that's the source of the problem.
I'll try compiling.
-JJR |
Well, maybe it's not the TreeIter because the TreeIter is not a presistent object.
But I believe I might be something like that, more testing is required... :(
I did step throught the Gtk+ code and it segfaults when refering to sibeling nodes of the base node to be removed.
I still don't understand why this doesn't happend on the old version. Somethimes adding a gc.fullCollect helps spotting these problems.
Ant |
|
Back to top |
|
|
JJR
Joined: 22 Feb 2004 Posts: 1104
|
Posted: Wed Jun 01, 2005 2:05 pm Post subject: |
|
|
Were all updates to the original DUI ported over to dynDUI?
I know it wasn't completely up to date when I was working on it. Maybe we missed something?
-JJR |
|
Back to top |
|
|
Ant
Joined: 06 Mar 2004 Posts: 306 Location: Canada
|
Posted: Wed Jun 01, 2005 3:13 pm Post subject: |
|
|
JJR wrote: | Were all updates to the original DUI ported over to dynDUI?
I know it wasn't completely up to date when I was working on it. Maybe we missed something?
-JJR |
Not all, just the ones that seem relevant.
Ant |
|
Back to top |
|
|
|