Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Jan 1998 22:30:46 -0600 (CST)
From:      Joel Ray Holveck <joelh@gnu.org>
To:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: sharable static arrays?
Message-ID:  <199801140430.WAA03884@detlev.UUCP>
In-Reply-To: <19980112112455.48744@flix.net> (message from Chrisy Luke on Mon, 12 Jan 1998 11:24:55 %2B0000)
References:  <199801121031.EAA00243@detlev.UUCP> <19980112112455.48744@flix.net>

next in thread | previous in thread | raw e-mail | index | archive | help

>> Are static arrays shared across multiple invocations of a program?
> Not intrinsicly. You'll have to either use SYS-V style shared
> memory (options SYSVSHM SYSVSEM SYSVMSG in a kernel config and
> shmget(2) etc) or use BSD style mapped memory (mmap(2)).

Hmm... Perhaps I should have used the C term.  For what I meant by
'static array', mmap (et al) would be utterly wrong.  My fault.

Are arrays declared const shared across multiple invocations of a
program?

That is, if I have an array
  const int foo[8192] = {...};
then will each instance of the invocation separately allocate 16k for
an array that's never going to change, and exists as it is in the
executable?

Cheers,
joelh

-- 
Joel Ray Holveck - joelh@gnu.org - http://www.wp.com/piquan
   Fourth law of programming:
   Anything that can go wrong wi
sendmail: segmentation violation - core dumped




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199801140430.WAA03884>