Messages in this thread | | | From | "Peter T. Breuer" <> | Subject | freeing a static after one use only? | Date | Thu, 17 Feb 2000 23:54:46 +0100 (MET) |
| |
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/
| |