Login
`
Templates, Tools and Utilities
|
||
Icetips Article
Back to article list
Search Articles
Add Comment
Printer friendly
Direct link
Clarion Environment (IDE etc.): Segment errors - cause and ways to help 2004-01-21 -- Robert Zaunere Newsgroups: softvelocity.public.clarion6
There are many theories floating about with regard to this "limit",
unfortunately none of them are accurate. There is a Zero correlation to any
16bit issue in C6 with this topic of SEGDEFs, as 16bit is not even supported
for compilations, and the segment limit has not changed from C5x.
As explanation as to what does happen, the linker must collect information
about object and resource files to be linked into the target. The limit for
number of segments per object file is ~16k.
The compiler produces segments for things like:
- Every Procedure or ROUTINE is a separate segment;
- Every static variable or constant string is a separate segment;
- Every FILE structure produces 5 segments, plus if the FILE declaration has
NAME, OWNER or driver string, one segment
per every for one of these strings, plus one possible segment if FILE is
threaded, every KEY, every Memo, every VIEW, every QUEUE, etc. etc.
So in general, the current linker limit means that a single source file can
have _thousands of declared (and used in the program) variables. The most
probable ways to get the "too many SEGDEF..." error are:
1- to include too many INCLUDEs that declare variables; solution is
to include files on the module level rather than globally everywhere
where it is possible
2- to declare too many FILEs with large number of KEYs and/or MEMOs in
one source file (the main source file, as a rule);
#1 is your control. As for #2 its also in your control, but we'll be providing
template support in C6.1 that will allow you to easily split the file structs
generated from extremely large DCTs (those with with many hundreds of files
defined in them) into > 1 source modules. That means that when such DCTs
produce an excess of the ~16000 segment limit you can get past it. However,
there are other alternatives you can take right now, like reducing the # of
files declared in a single DCT to something more in line with what Files are
really being used in the APP, or to declare files on the member module level if
this is possible (i.e. the FILE is only used in particular procedure ). But
the template solution will be forthcoming.
Regards,
Robert Zaunere
SoftVelocity Inc.
On Wed, Jan 21 2004 12:02 pm, Robert Wagner
Today is November 21, 2024, 3:46 am This article has been viewed 35396 times. Google search has resulted in 203 hits on this article since January 25, 2004.
|
|