Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Oct 2000 20:57:26 -0800 (PST)
From:      harsha v <bsd_linux@yahoo.com>
To:        bright@wintelcom.net
Cc:        freebsd-questions@freebsd.org
Subject:   Re:mem prob
Message-ID:  <20001031045726.71884.qmail@web10608.mail.yahoo.com>

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

[-- Attachment #1 --]
hi,
   i have attached file which has the declaration of
the objects and the file in which the invocation of
the main function.

i am sorry that i using a differ3ent mail address now.
the other mail id does'nt support attachments.

i would appreciate any help in this regard

------------- Original Message --------------
Alfred Perlstein  wrote:
To:harsha <crazyharshu@rediffmail.com>
From:Alfred Perlstein <bright@wintelcom.net>
Date:Mon, 30 Oct 2000 09:29:05 -0800
CC:"freebsd-questions@freebsd.org"
<freebsd-questions@FreeBSD.ORG>
Subject: Re: mem prob

* harsha  <crazyharshu@rediffmail.com> [001030 09:19]
wrote:
> hi,
>    i need some help on this.
> 
>    i am trying to allocate static array of objects
size 70MB. the array is 
> declared as a local variable. the executable dumped
a core.

Please provide some sample source.

-Alfred

__________________________________________________
Do You Yahoo!?
Yahoo! Messenger - Talk while you surf!  It's FREE.
http://im.yahoo.com/
[-- Attachment #2 --]
send/004075500017530000012000000000000717745231000123765ustar00fcs1hvstaff00002300000000send/ext-belady.cc010064400017530000012000000015650717745227700147630ustar00fcs1hvstaff00002300000000
#include <iostream.h>
#include "mydef.h"  
#include "node.cc"
#include "edge.cc"
#include "tempo_ext.cc"
#include "spatial.cc"

/*                               main()
--------------------------------------------------------------------------------

*/ 
 
main(void)
 {
  u_int no_of_nodes_count=0;  /* Number of address generated.                 */
  u_int miss=0;               /* The no of misses that have occured.          */
  ll_int input_addr=0;        /* Temporary variable to hold the input.        */

/*
 * 1. Declaring pointers of the type src_node for both temporal & spatial edges
 * 2. Declaring an array of object of the inherited class node_defi.
 */
 
  src_node *temp_src;         
  src_node *spat_src;       
  node_defi node[ARRAY_SIZE]; 
  
  while((cin>>input_addr))    /* Reading the input from benchmark.            */
   {
.
.
.
.
.
.
.
.
..
.
.
.
.
.
 }
send/node.cc010064400017530000012000000067640717745231000136440ustar00fcs1hvstaff00002300000000#include "mydef.h"
class node_def
      {
       private:
                ll_int addr;       /* Holds the address.                      */
                u_int  ms;         /* Keeps track of the mem alloc.           */
       public:
                node_def();        /* Constructor initializes addr and ms.    */
         void   Update_val(void);  /* Increases the mem reserved at the node. */
         u_int  Show_val(void);    /* Returns mem reserved at a node.         */
         void   Input_val(ll_int); /* Assigns the address to the node.        */
         ll_int Show_addr(void);   /* Returns the address held in the node.   */
      };

node_def::node_def()
      {
        addr=0;                    /* Initializing the address.               */
        ms=0;                      /* Initializing the memory reserved.       */
      }

void node_def::Update_val(void)      
      {
       ms++;                       /* Incrementing  mem reserved at the node. */
      }

u_int node_def::Show_val(void)
      {
        return ms;                 /* Returning the mem reserved at the node. */
      }

void node_def::Input_val(ll_int val)
      {
       addr=val;                   /* Assigning the address value from input. */
      }
  
ll_int node_def::Show_addr(void)
      {
       return addr;                /* Returning the address value in node.    */
      }



class node_defi:public node_def    /* Inheriting the base class node_def.     */
      {
       private:
               u_int miss;         /* Indicates wether this node was a hit or
				      miss.                                   */
       public: 
               node_defi();           /* Constructor  initializes miss.       */
               void  Set_miss(void);  /* setting the flag as MISS.            */
               u_int Show_miss(void); /* showing the value of the flag.       */
      };

node_defi::node_defi()
      {
       miss=HIT;                   /* Constructor initialses node to be a hit.*/
      }

void node_defi::Set_miss(void)
      {
       miss=MISS;                  /* Setting the flag to be Miss.            */
      }

u_int node_defi::Show_miss(void)
      {
       return miss;                /* Returning the value of the flag.        */
      }


class src_node
      {
       private:
         u_int dis;                /* Holds the length of the spatial edge.   */
         u_int index;              /* Holds the location of source node.      */

       public:
               src_node();         /* Constructor initializes dis and index.  */
         void  Dis_in(u_int);      /* Updates the value of dis.               */
         u_int Dis_show(void);     /* Returns the length of the spatial edge. */
         void  Index_in(u_int);    /* Updates the index value.                */
         u_int Index_show(void);   /* Returns the value of the index.         */
       };

src_node::src_node()
       {
        dis=0;                     /* Initialising.                           */
        index=0;
       }

void src_node::Dis_in(u_int in)
       {
        dis=in;                    /* Updating the edge distance.             */
       }

u_int src_node::Dis_show(void)
       {
        return dis;                /* Returning the edge distance.            */
       }

void src_node::Index_in(u_int in)
       {
        index=in;                  /* Updating the index value.               */
       }

u_int src_node::Index_show(void)
       {
         return index;             /* Returning the index value.              */
       }

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