Re: Doubt in sizeof () operator

2009-11-07 Thread hmthalib
govind raj nayak wrote: Hi, While going through the code of IPC semaphore implementation, I encountered a statement: new = ipc_rcu_alloc(sizeof(struct kern_ipc_perm *)*newsize +sizeof(struct ipc_id_ary)) I am not able to understand how memory will be allocated by the above statement. Insi

Doubt in sizeof () operator

2009-11-05 Thread govind raj nayak
Hi, While going through the code of IPC semaphore implementation, I encountered a statement: new = ipc_rcu_alloc(sizeof(struct kern_ipc_perm *)*newsize +sizeof(struct ipc_id_ary)) I am not able to understand how memory will be allocated by the above statement. Inside the sizeof() operat

Re: Re: Doubt in sizeof () operator

2009-11-05 Thread govind raj nayak
My bad...that's a simple multiplication...confused it for dereferencing... On Fri, 06 Nov 2009 11:41:22 +0530 wrote >Just a correction..."*newsize" is inside ipc_rcu_alloc. I want to understand >how memory will be allocated and what's the role of *newsize? > > "newsize" is an int holding

Re: Doubt in sizeof () operator

2009-11-05 Thread govind raj nayak
Just a correction..."*newsize" is inside ipc_rcu_alloc. I want to understand how memory will be allocated and what's the role of *newsize? "newsize" is an int holding the value 128. -Govindraj On Fri, 06 Nov 2009 11:38:34 +0530 wrote >Hi, > > While going through the code of IPC sem