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:
   > > 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).
   > 
   > The underlying problem is that I do not see any benefit from arbitrary
   > typedefs such as struct x -> x_t.  Will we get u32_t next?
   
   I understand that it is a personal preference, but at least to me, it would
   increase readability. It would be good to hear opinions of more people who
   are working in sys/uvm.

:-)

i generally prefer "struct foo".  "foo_t" almost always send me off
looking into some header file to see what it really means.

   > There are plenty of places in the kernel where _t is a pointer.  How are
   > you supposed to distinguish between them?  More specifically to this case,
   > when vm_page_t existed in NetBSD with the Mach vm, it was a pointer.
   
   I do not see a necessity to have any _t which would be a pointer in sys/uvm.
   Keep things simple. Historical point should not disturb, we have UVM now,
   not Mach VM. Solaris VM, for example, has structures typedef'ed.

honestly, if you going to do this, please rename all the "struct vm_foo"'s
to "struct uvm_foo".  the current method with some of each is historical
baggage to the integration of UVM and it has always bothered me.

that would also avoid any confusion for folks with mach vm knowledge.


.mrg.


Home | Main Index | Thread Index | Old Index