tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: UVM typedef struct



Antti Kantee <pooka%cs.hut.fi@localhost> wrote:
> On Mon Jun 15 2009 at 20:09:56 +0100, Mindaugas Rasiukevicius wrote:
> > I would like to typedef and replace the struct usage in UVM, so that
> > struct vm_map would become vm_map_t, struct vm_anon - vm_anon_t, and so
> > on. <...>

Just to make this clear, I do not want to typedef structs as pointers.
I agree that it is confusing (although it has a good rationale for some
cases, eg. when structure size is dynamic).

> 1) obfuscates code.  there is no reason to tell if silly_t is an int,
>    struct or pointer to something just by looking at the type

I am not sure what do you mean. Each typedef, eg. vm_page_t would be a
structure, where vm_page_t * a pointer to it. No intention to typedef
non-structures in UVM.

> 2) impossible to provide forward declarations for interfaces using
>    silly_t

Why not? Note that struct declarations wont be removed (cf. struct lwp
and lwp_t).

-- 
Best regards,
Mindaugas


Home | Main Index | Thread Index | Old Index