From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,20b261795a1761e1 X-Google-Attributes: gidfa528,public X-Google-ArrivalTime: 2001-08-02 21:55:08 PST Path: archiver1.google.com!newsfeed.google.com!postnews1.google.com!not-for-mail From: banny52@yahoo.com (Ginny E. Kim) Newsgroups: comp.unix.tru64 Subject: Re: Kernel memory Date: 2 Aug 2001 21:55:07 -0700 Organization: http://groups.google.com/ Message-ID: <2f6bec0a.0108022055.24136296@posting.google.com> References: <2f6bec0a.0108020002.29080aa8@posting.google.com> <020820010901584492%harris@zk3.dec.com> NNTP-Posting-Host: 210.205.15.123 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 996814508 10596 127.0.0.1 (3 Aug 2001 04:55:08 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 3 Aug 2001 04:55:08 GMT Xref: archiver1.google.com comp.unix.tru64:4058 Bob Harris 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 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?