The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 11-17-2007
Legend986 Legend986 is offline
Registered User
  
 

Join Date: Sep 2007
Posts: 171
What does this statement mean?

If I declare a structure as:


Code:
typedef struct
	{
		int id;
		void* ptr;
		int size;
	} kpage_t;

And then use this to do some initialization...


Code:
*((kpage_t**)page->ptr) = page;

What exactly is being done? I have some trouble with pointers here...

And if there's a macro BASEADDRESS(x) defined as

Code:
((void*)(((int) (x)) & ~(PAGESIZE-1)))

What exactly is happening here assuming that PAGESIZE is a power of two number...