lkml.org 
[lkml]   [2000]   [Feb]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subjectfreeing a static after one use only?
Date
I have another request for help ... I humbly beseech such advice
as may be bestown.

I have a large static initialized array that that is compiled into a
module (it's a translation table, int to char*). I want to

use it once and then throw it away

after it has been used for the purpose it was defined for: translating
kernel data into another format. The latter will be supplied by the
module to readers on demand.

So ... is there a magic gcc incantation to do this? It's about 20KB
of static data. I.e.

static const FOO array[] = {
...
{ 23, "holiday_time" },
...
};

init_module() {
...
use_the_thing_to_make_a_new_thing(array,new_array);
throw_away_the_thing(array);
...
}


It's much larger than the thing it's used to create, so there is no
advantage in overwriting it with the result.

(I imagine that some of the lowlevel sound card drivers do this, when
they want to load firmware).

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    [W:0.071 / U:0.708 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site