Re: freeing a static after one use only?

From: Peter T. Breuer (ptb@it.uc3m.es)
Date: Fri Feb 18 2000 - 02:33:58 EST


"A month of sundays ago Mike Galbraith wrote:"
> On Thu, 17 Feb 2000, Peter T. Breuer wrote:
> > use it once and then throw it away
>
> vi://TheSource/include/linux/init.h/__initdata

Very promising ...

 * For initialized data:
 * You should insert __initdata between the variable name and equal
 * sign followed by value, e.g.:
 *
 * static int init_variable __initdata = 0;
 * static char linux_logo[] __initdata = { 0x32, 0x36, ... };
 *
 * For initialized data not at file scope, i.e. within a function,
 * you should use __initlocaldata instead, due to a bug in GCC 2.7.

I'll let you know if I get it to work. The compiler complains here.

       static CrossRef uIndex[] __initlocaldata = {
       #include "all_config.data"
       { 0 , 0 },
       };

      setup.c: In function `init_module':
      setup.c:81: syntax error before `__initlocaldata'

(commenting out the __initlocaldata makes it all OK).

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/



This archive was generated by hypermail 2b29 : Wed Feb 23 2000 - 21:00:20 EST