Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Sep 1997 17:48:32 -0400
From:      Randall Hopper <rhh@ct.picker.com>
To:        Luigi Rizzo <luigi@labinfo.iet.unipi.it>
Cc:        multimedia@FreeBSD.ORG
Subject:   Re: fxtv size...
Message-ID:  <19970914174832.50880@ct.picker.com>
In-Reply-To: <199709141824.UAA00743@labinfo.iet.unipi.it>; from Luigi Rizzo on Sun, Sep 14, 1997 at 08:24:51PM %2B0200
References:  <199709141824.UAA00743@labinfo.iet.unipi.it>

next in thread | previous in thread | raw e-mail | index | archive | help
Luigi Rizzo:
 |increased a lot in size. The most impressive is "tv.c" which is 474
 |lines yielding 22K of text. As a comparison, the original "tv.c" is 393
 |lines in my sources and generates 3.2K of code.
 |
 |Is there something going wrong with macro expansions, or what ?

That seemed strange to me too.  So I played with it a sec and what's going
on is that gcc is placing all the static string data in the text segment.

Come to think about it, I like this idea.  Since text is read-only,
attempts to do ugly things like modifying static strings directly results
in a bus error.

     #include <stdio.h>
     main() { char *abc = "xxxx"; abc[0] = '1'; puts(abc); }
                                         ^ core dump

Also, if multiple copies of a prog with significant amounts of static
strings are running, only one copy of those strings are ever in memory at
once.  The latter is irrelevent to fxtv, of course, but good for other apps.

BTW, tv.o is the module that declares all the fallback resources, help
strings, etc.  which is why its text (and data somewhat) size bumped up
from 3k to 21k.  See app_rsrc.h.  

Randall



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19970914174832.50880>