A Question About kernel source code

From: Feng Chun (chfeng520@263.net)
Date: Tue Feb 06 2001 - 03:39:11 EST


Hello everyone:
        I have a question about the linux source code.

consider the function:get_vm_area( mm/vmalloc.c )
struct vm_struct * get_vm_area(unsigned long size)
{
         struct vm_struct **p,
        ....
        for (p = &vmlist; (tmp = *p) ; p = &tmp->next) {
        if (size + addr < (unsigned long) tmp->addr)
                break;
        addr = tmp->size + (unsigned long) tmp->addr;
        if (addr > VMALLOC_END-size) {
                kfree(area);
                return NULL;
        }
}
....
}

notice that here p is defined as a pointer to a pointer, why not

struct vm_struct *p,
for (p=vmlist; (tmp=p); p=tmp->next) {
..
}

does it mean that the later is not efficient as the former?

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Feb 07 2001 - 21:00:23 EST