Path: utzoo!attcan!uunet!husc6!mailrus!ames!umd5!uflorida!novavax!proxftl!bill
From: bill@proxftl.UUCP (T. William Wells)
Newsgroups: comp.lang.c
Subject: Re: putting stuff in the text segment
Summary: try const
Message-ID: <307@proxftl.UUCP>
Date: 12 Jun 88 19:51:10 GMT
References: <3813@lynx.UUCP> <1457@laidbak.UUCP>
Distribution: na
Organization: Proximity Technology, Ft. Lauderdale
Lines: 19

In article <1457@laidbak.UUCP>, daveb@laidbak.UUCP (Dave Burton) writes:
) In article <3813@lynx.UUCP> m5@lynx.UUCP (Mike McNally) writes:
) |Does a widely-accepted syntax extension to put data structures in the
) |text segment exist?  We are thinking about adding something like this
) |to our compiler in order to reduce memory use by oft-forked large
) |applications.  I had in mind a couple of new storage classes, maybe
) |"rom" and "staticrom".

The const keyword of Standard C, when applied to a statically
allocated variable, implies that one can place the variable in a
read-only segment; even if your text segments are read-only, any
variable marked const could be placed there.

Otherwise, you could define various qualifiers which can be used
like const but which specify a segment instead of an attribute.
Like defining storage new storage classes (actually new storage
class modifiers), this is relatively innocuous; porting to
another system just requires adding some #defines to get rid of
the new keywords.