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 06:01:59 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!paloalto-snf1.gtei.net!news.gtei.net!news.compaq.com!news.cpqcorp.net!harris Subject: Re: Kernel memory From: Bob Harris Newsgroups: comp.unix.tru64 Posted-And-Mailed: yes Message-ID: <020820010901584492%harris@zk3.dec.com> References: <2f6bec0a.0108020002.29080aa8@posting.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-transfer-encoding: 8bit User-Agent: YA-NewsWatcher/5.0.1 Date: Thu, 02 Aug 2001 09:01:58 -0400 NNTP-Posting-Host: 16.140.32.194 X-Complaints-To: abuse@Compaq.com X-Trace: news.cpqcorp.net 996757318 16.140.32.194 (Thu, 02 Aug 2001 06:01:58 PDT) NNTP-Posting-Date: Thu, 02 Aug 2001 06:01:58 PDT Organization: Compaq Computer Corporation Xref: archiver1.google.com comp.unix.tru64:4047 [[ 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