From owner-freebsd-multimedia Sun Sep 14 14:53:18 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id OAA02634 for multimedia-outgoing; Sun, 14 Sep 1997 14:53:18 -0700 (PDT) Received: from whqvax.picker.com (whqvax.picker.com [144.54.1.1]) by hub.freebsd.org (8.8.7/8.8.7) with SMTP id OAA02629 for ; Sun, 14 Sep 1997 14:53:11 -0700 (PDT) Received: from ct.picker.com by whqvax.picker.com with SMTP; Sun, 14 Sep 1997 17:52:06 -0400 (EDT) Received: from elmer.ct.picker.com ([144.54.57.34]) by ct.picker.com (4.1/SMI-4.1) id AA27964; Sun, 14 Sep 97 17:52:05 EDT Received: by elmer.ct.picker.com (SMI-8.6/SMI-SVR4) id RAA09068; Sun, 14 Sep 1997 17:48:33 -0400 Message-Id: <19970914174832.50880@ct.picker.com> Date: Sun, 14 Sep 1997 17:48:32 -0400 From: Randall Hopper To: Luigi Rizzo Cc: multimedia@FreeBSD.ORG Subject: Re: fxtv size... References: <199709141824.UAA00743@labinfo.iet.unipi.it> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.81 In-Reply-To: <199709141824.UAA00743@labinfo.iet.unipi.it>; from Luigi Rizzo on Sun, Sep 14, 1997 at 08:24:51PM +0200 Sender: owner-freebsd-multimedia@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk 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 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