lkml.org 
[lkml]   [1998]   [Jul]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [linux-usb] How to get aligned memory?
     >         This is a so silly question I feel dumb for not having able to
    > find it myself ... how can I get aligned memory?
    >
    > The problem is I have this structure, 64 bits long which needs
    > to be aligned to 16 bytes (thx, Intel >:), but I cannot find my to do
    > it (except to allocate a lot until I get it aligned, which is quite
    > wasteful :).
    Have a look at the malloc man page. I think it tells you that a block of
    n bytes (n a power of two) is aligned to the nearest higher power of
    two, guarantueed. At least that is the way the Framelist is aligned in
    my code. I do check that in debugging mode but it has not failed up to
    now.

    Nick

    --
    building: 27A
    address: STA-ISIS, T.P.270, Joint Research Centre, 21020 Ispra, Italy
    tel.: +39 332 78 9549
    fax.: +39 332 78 9185


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

    \
     
     \ /
      Last update: 2005-03-22 13:43    [W:0.018 / U:29.260 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site