Usenet comp.unix.tru64 (2000-2013)
 help / color / mirror / Atom feed
From: banny52@yahoo.com (Ginny E. Kim)
Subject: Re: Kernel memory
Date: 2 Aug 2001 21:55:07 -0700	[thread overview]
Message-ID: <2f6bec0a.0108022055.24136296@posting.google.com> (raw)
In-Reply-To: 020820010901584492%harris@zk3.dec.com

Bob Harris <harris@zk3.dec.com> wrote in message news:<020820010901584492%harris@zk3.dec.com>...
> [[ This message was both posted and mailed: see
>    the "To," "Cc," and "Newsgroups" headers for details. ]]
> 
> In article <2f6bec0a.0108020002.29080aa8@posting.google.com>, Ginny E.
> Kim <banny52@yahoo.com> wrote:
> 
> X  --------------------
> X  #if defined(__DECC) && __DECC_VER >= 50860003
> X  #define FINDINDEX(size) (__builtin_isconstant(size) ?
> X  BUCKETINDEX(size) : -1)
> X  #else
> X  #define FINDINDEX(size) BUCKETINDEX(size)
> X  #endif
> X  
> X  #define MALLOC(space, cast, size, type, flags) \
> X          (space) = (cast)malloc((u_long)(size), FINDINDEX(size), type,
> X  flags)
> X  
> X  
> X  int     statesize = 5737;
> X  static state_t **table = NULL;
> X  
> X  int table_init()
> X  {
> X          MALLOC(table, state_t **, sizeof(state_t *) * statesize,
> X  M_TEMP, M_NOWAIT);
> X          if (table != NULL)
> X                  bzero((char *)table, statesize * sizeof(state_t *));
> X          else {
> X                  return -1;
> X          }
> X              ......................
> X  }
> X  -------------------------------------------
> X  
> X  In this case, if statesize is 5737, I can't have the system to
> X  allocate memory using MALLOC. if statesize is 127 or 100, system can
> X  allocate memory using MALLOC.
> X  This program is a part of the loadable kernel module in Tru64UNIX 5.1.
> X  Do Tru64UNIX V5.1 have the option that kernel memory to be allocate is
> X  limited?
> X  If then, how can it be increased?
> 
> MALLOC is used when the size of the storage can be specified as either
> a hard coded constant, a #define contant, or a sizeof(...) constant.
> 
> MALLOC_VAR is used when the size of the storage is passed as a
> variable.  'statesize' is a variable and thus you should be using
> MALLOC_VAR
> 
>                                         Bob Harris

I used the size of the storage of MALLOC be specified as a hard coded constant.
For instance, 
             #define STATESIZE 5737
             statesize = STATESIZE
I don't think 'statesize' is a variable.
MALLOC() in Tru64 V4.0F doesn't have this problem.
Doesn't the type or flag of malloc() have the problem?


  reply	other threads:[~2001-08-03  4:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-02  8:02 Kernel memory Ginny E. Kim
2001-08-02 13:01 ` Bob Harris
2001-08-03  4:55   ` Ginny E. Kim [this message]
2001-08-03 13:43     ` Brian Haley
2001-08-04  6:32       ` Ginny E. Kim
2001-08-10 15:48         ` Brian Haley
2001-08-13  5:21           ` Ginny E. Kim
2001-08-13 18:47             ` Brian Haley
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox