[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gnome-devel-list
Subject:    Re: constant variables are not always placed in shared memory
From:       "Edward A. Falk" <falk () efalk ! org>
Date:       2003-03-30 18:10:59
Message-ID: 200303301810.h2UIAxJ25853 () falconer ! efalk ! org
[Download RAW message or body]

> static const char * const my_strings[] = {
>   "hello", "world", "foo"
> }

I think there are two reasons for my_strings not to be shared.

First, my_strings was *not* declared const (the strings it points to
are, but not my_strings itself.  I think it would have to be declared

	const char *const my_strings[] = {...}

for my_strings to be const.


But even so, I still don't think it could be shared between processes
due to relocation.  Each process would see the strings at a different
address and would require a private copy of my_strings to point to
that address.

	-ed falk

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic