tech-kern archive

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

Re: btuart and SOCKET Bluetooth CF



On Sun, 14 Feb 2010, KIYOHARA Takashi wrote:

> Is the efficiency that you think about a memory size? Or, is it a speed?
> The count of the m_adj() and the 'if (...)' is the same as you and me in
> the source of C.  And, I leave efficiency to the compiler.

You didn't count the whole lifetime of that byte..

        if (drop)
                return;

is cheaper than

        if (mbuf is full)
                extend mbuf

        add byte;

        if (drop)
                m_adj(m, -1)    /* (may need to scan mbuf chain) */

> I devised a different method.  This executes processing to attach
> different according to cfdata->cf_atname.

I think depending on ldisc->l_name was cleaner. (no need for #ifdef)


in btuart_dtl_output_*(), M_WAITOK is not permitted, and m_copyback() can
fail, the result should be tested..

iain




Home | Main Index | Thread Index | Old Index