VirtualBox

Changeset 1900 in kBuild


Ignore:
Timestamp:
Oct 21, 2008 2:03:55 AM (16 years ago)
Author:
bird
Message:

strcache2: cacheline alignment.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/strcache2.h

    r1897 r1900  
    5151};
    5252
    53 /* The entry alignment.
    54    As it is very difficult to derive this from any #define or typedef, a
    55    default value of 16 (chars) was choosen as this fits most platforms.
    56    For odd platforms, just override this define.  */
     53/* The entry alignment, cacheline size if it's known & sensible.
     54
     55   On x86/AMD64 we assume a 64-byte cacheline size.  As it is difficult to
     56   guess other right now, these default 16 chars as that shouldn't cause
     57   much trouble, even if it not the most optimial value.  Override, or modify
     58   for other platforms.  */
    5759#ifndef STRCACHE2_ENTRY_ALIGN_SHIFT
    58 # define STRCACHE2_ENTRY_ALIGN_SHIFT    4
     60# if defined (__i386__) || defined(__x86_64__)
     61#  define STRCACHE2_ENTRY_ALIGN_SHIFT    6
     62# else
     63#  define STRCACHE2_ENTRY_ALIGN_SHIFT    4
     64# endif
    5965#endif
    6066#define STRCACHE2_ENTRY_ALIGNMENT       (1 << STRCACHE2_ENTRY_ALIGN_SHIFT)
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette