Hi folks,

Infamous Bug 666629 [can't build gtk2 frontend] now occurs for me too on
an alternate gcc-3.2.1 platform. Bug doesn't occur on the gcc-2.95.3
platform, which has slightly higher mem, swap, and cpu speed (none I
find that significant though).

Fixing this bug is now my priority since it not only annoys me, but also
may scare new users away from gtkg (and I think it gives a wrong idea of
the effort put into the software in general).

Quoting sourceforge entry for bug 666629 :
>
> Date: 2003-01-13 09:40 
> Sender: rmanfredi
> Logged In: YES 
> user_id=13887
>
> For now, try to compile with -O0.
>
> We're going to study how to avoid having one big happy file
> to compile, and split it into several files to ease
> compiling on systems with little memory.
>

File size is not the culprit here. Please consider the following :

On the gcc-2.95.3 platform, interface_glade2.c compiles fine,
though it takes some time.

On the gcc-3.2.1 platform, compilation goes ok for a while,
then suddenly saturates mem and swap, to no avail for 30 seconds
(after that it gets killed by yours truly before the kernel
crushes something else).

Playing with the code revealed create_main_window() is the culprit.
Even compiling it alone leads to the same result. And if you #if it away,
the remaining of the module compiles fine, even create_dlg_filters(),
which is quite huge too.

This may be a bug in gcc-3.2.1. However, create_main_window() proudly
bearing *eight* *hundred* auto variables doesn't seem like the Right
Thing either.

Glade generates this code. Apart from patching glade, here are our options :

1) Use libglade to parse the UI at runtime. Simple. Scalable. Will slow
   widget creation enough that gtkg will start up significantly slower on
   some machines. Requires us to depend on libglade, which is not that
   painful, since we already depend on libxml2, which is also part of gnome.

2) Make do with what we have. Huge UI creation functions mean either a
   highly cluttered or a highly recursive interface, or both.
   gtkg's UI is highly recursive. Basically, it uses a lot of tabs.
   We can take the code to create each tab's content off create_main_window()
   and create_dlg_filters() and put it each in its own window in another
   glade project. Then we use some code at runtime to reparent
   the widgets right where they should be.

I'm able to implement both options. Time, scalability and code reuse advise
me to prefer the first. The hacker spirit rushes me to code the second.

What do you think ?


Cheers,


ko [junkpile at free dot fr on this platform]


-- If your program can go wrong 16 minutes before a safe landing
   after a 16 day mission, it will.





-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
Gtk-gnutella-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/gtk-gnutella-devel

Reply via email to