[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Syntax question...



Armbrust, Daniel C. wrote:

Howard recommended that I modify back-bdb/idl.h BDB_IDL_DB_SIZE and BDB_IDL_UM_SIZE to work around a problem I reported (ITS #3343).

Those lines of code are:

/* IDL sizes - likely should be even bigger
*   limiting factors: sizeof(ID), thread stack size
*/
#define BDB_IDL_DB_SIZE         (1<<16) /* 64K IDL on disk */
#define BDB_IDL_UM_SIZE         (1<<17) /* 128K IDL in memory */


This is probably something I should know - but what numbers would I put in here if I wanted to quadruple each of these variable values? I don't understand the syntax of (1<<16) (and haven't been able to find any documentation)


That's the (left) shift operator; it means: "take the left operand (1) and shift it leftwise (towards higher values) as many bits as indicated by the right operand. I think Howard used that to make it clear what power of 2 he was using :) You can read it as 2^16 and 2^17 respectively, so to quadruple them you may use (1<<20) and (1<<21).

p.




SysNet - via Dossi,8 27100 Pavia Tel: +390382573859 Fax: +390382476497