lkml.org 
[lkml]   [2000]   [Feb]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: freeing a static after one use only?
Date
"A month of sundays ago Mike Galbraith wrote:"
> Strike Two:
> Package data in a seperate module.. load/use/eject?

As near as I can tell, the problems I was having with this idea seem to
be related to what gcc does when faced with

static Foo foo;
...
{
Foo bar[] = { .. masses of constants .. }
foo = bar;
...
as opposed to

static Foo foo[] = { .. masses of constants .. }
The latter is written correctly from the second module. The first form
apparently tries to make itself automatic (best guess, despite the
owww! in the consequences). Sprinkling the word "const" around didn't
help.

It certainly caused weird limited, nonfatal effects. Namely localised
corruption on the array when reading back from it after having written
to a different, kmalloc'ed area. It looks like the array got overwritten
with addresses and data, which makes me think it got used as stack.
Addresses in the range 0xC010.... were common.
The problem is currently "solved".

Peter

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:56    [from the cache]
©2003-2011 Jasper Spaans. Advertise on this site