From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24297 invoked by alias); 14 Oct 2004 05:13:05 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 24279 invoked from network); 14 Oct 2004 05:13:03 -0000 Received: from unknown (HELO redpinesignals.com) (203.196.161.92) by sourceware.org with SMTP; 14 Oct 2004 05:13:03 -0000 Received: from [192.168.1.11] ([192.168.1.11]) by redpinesignals.com (8.11.6+Sun/8.11.6) with ESMTP id i9E2rBD01175; Thu, 14 Oct 2004 10:53:11 +0800 (CST) Message-ID: <416E0CA7.4050309@redpinesignals.com> Date: Thu, 14 Oct 2004 05:13:00 -0000 From: Sriharsha Vedurmudi User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.2) Gecko/20040803 MIME-Version: 1.0 To: Vinay CC: gcc Subject: Re: (Question reframed)Storing specified variables in the same memory page! References: <20041013180434.88918.qmail@web8505.mail.in.yahoo.com> In-Reply-To: <20041013180434.88918.qmail@web8505.mail.in.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-10/txt/msg00100.txt.bz2 Hi Vinay, is your aim something like an intelligent program editor where-in you write a program and execute the 'compile' option in the editor. Here the editor picks up the source program and passes it on to the compiler for compilation. The extra functionality you need is that some of the variables that are explicitly specified should be allocated in contiguous/successive memory locations? Is it? Well, I am not aware of any such options for gcc atleast, but I feel that such things are to be taken care in the source program itself. Encapsulate them in a structure, as suggested earlier. Still I wonder why you would want them on a same memory page? Is it purely for speed optimization? Regards, Harsha. Vinay wrote: >Hello all, > >Thank you very much for all your replies. But the >project requirements are different. The problem is as >follows. > >A main program shall be running. An user source >program is given as input to the main program. Along >with the source program, some variables present in the >source program shall also be specified. From the main >program, I need to inform the compiler to allocate >successive memory locations for these variables so >that they reside on the same memory page. > >The main program is not allowed to change the type of >the variables. > >Please give suggestions. > >Thanks, >Vinay >--- energon wrote: > > >>Well, you can define a struct with the necessary >>variable types and >>allocate some shared memory and map the struct into >>the shared memory. >> >>Typically, shared memory is allocated in size of >>page size chunks. >>So, if your data set size does not span the memory >>page size, you'll >>have your data in one page. >> >>Do you need to avoid your data from being paged out >>of the RAM? >> >> >>===== >>-energon0 >> >> >> >>_______________________________ >>Do you Yahoo!? >>Declare Yourself - Register online to vote today! >>http://vote.yahoo.com >> >> >> > >________________________________________________________________________ >Yahoo! India Matrimony: Find your life partner online >Go to: http://yahoo.shaadi.com/india-matrimony > > -- ***************************** * Sriharsha Vedurmudi * Software Engineer * * Redpine Signals Inc. * Gate #395, Plot 87,88 * Sagar Society, Road #2, * Banjara Hills, * Hyderabad - 500 034 * www.redpinesignals.com * * +91-40-23559911 (Office) * +91-9849133133 (Mobile) *****************************