lkml.org 
[lkml]   [2000]   [Feb]   [18]   [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:"
> 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/

\
 
 \ /
  Last update: 2005-03-22 13:56    [W:0.138 / U:0.864 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site