VirtualBox

Changeset 22308 in vbox


Ignore:
Timestamp:
Aug 17, 2009 8:58:21 PM (15 years ago)
Author:
vboxsync
Message:

Runtime: Add RTFOFF Avl tree variant for the I/O cache

Location:
trunk
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/avl.h

    r20740 r22308  
    917917
    918918
     919/** AVL tree of RTFOFF ranges.
     920 * @{
     921 */
     922
     923/**
     924 * AVL Core node.
     925 */
     926typedef struct _AVLRFOFFNodeCore
     927{
     928    /** First key value in the range (inclusive). */
     929    RTFOFF             Key;
     930    /** Last key value in the range (inclusive). */
     931    RTFOFF             KeyLast;
     932    /** Offset to the left leaf node, relative to this field. */
     933    struct _AVLRFOFFNodeCore  *pLeft;
     934    /** Offset to the right leaf node, relative to this field. */
     935    struct _AVLRFOFFNodeCore  *pRight;
     936    /** Height of this tree: max(height(left), height(right)) + 1 */
     937    unsigned char       uchHeight;
     938} AVLRFOFFNODECORE, *PAVLRFOFFNODECORE;
     939
     940/** A pointer based tree with RTFOFF ranges. */
     941typedef PAVLRFOFFNODECORE AVLRFOFFTREE;
     942/** Pointer to a pointer based tree with RTFOFF ranges. */
     943typedef AVLRFOFFTREE    *PAVLRFOFFTREE;
     944
     945/** Pointer to an internal tree pointer.
     946 * In this case it's a pointer to a relative offset. */
     947typedef AVLRFOFFTREE    *PPAVLRFOFFNODECORE;
     948
     949/** Callback function for RTAvlrGCPtrDoWithAll() and RTAvlrGCPtrDestroy(). */
     950typedef DECLCALLBACK(int)   AVLRFOFFCALLBACK(PAVLRFOFFNODECORE pNode, void *pvUser);
     951/** Pointer to callback function for RTAvlrGCPtrDoWithAll() and RTAvlrGCPtrDestroy(). */
     952typedef AVLRFOFFCALLBACK *PAVLRFOFFCALLBACK;
     953
     954RTDECL(bool)                  RTAvlrFileOffsetInsert(       PAVLRFOFFTREE pTree, PAVLRFOFFNODECORE pNode);
     955RTDECL(PAVLRFOFFNODECORE)     RTAvlrFileOffsetRemove(       PAVLRFOFFTREE pTree, RTFOFF Key);
     956RTDECL(PAVLRFOFFNODECORE)     RTAvlrFileOffsetGet(          PAVLRFOFFTREE pTree, RTFOFF Key);
     957RTDECL(PAVLRFOFFNODECORE)     RTAvlrFileOffsetGetBestFit(   PAVLRFOFFTREE pTree, RTFOFF Key, bool fAbove);
     958RTDECL(PAVLRFOFFNODECORE)     RTAvlrFileOffsetRangeGet(     PAVLRFOFFTREE pTree, RTFOFF Key);
     959RTDECL(PAVLRFOFFNODECORE)     RTAvlrFileOffsetRangeRemove(  PAVLRFOFFTREE pTree, RTFOFF Key);
     960RTDECL(int)                   RTAvlrFileOffsetDoWithAll(    PAVLRFOFFTREE pTree, int fFromLeft, PAVLRFOFFCALLBACK pfnCallBack, void *pvParam);
     961RTDECL(int)                   RTAvlrFileOffsetDestroy(      PAVLRFOFFTREE pTree, PAVLRFOFFCALLBACK pfnCallBack, void *pvParam);
     962RTDECL(PAVLRFOFFNODECORE)     RTAvlrFileOffsetGetRoot(      PAVLRFOFFTREE pTree);
     963RTDECL(PAVLRFOFFNODECORE)     RTAvlrFileOffsetGetLeft(      PAVLRFOFFNODECORE pNode);
     964RTDECL(PAVLRFOFFNODECORE)     RTAvlrFileOffsetGetRight(     PAVLRFOFFNODECORE pNode);
     965
     966/** @} */
     967
    919968/** @} */
    920969
  • trunk/src/VBox/Runtime/Makefile.kmk

    r22109 r22308  
    294294        common/table/avlroogcptr.cpp \
    295295        common/table/avlruintptr.cpp \
     296        common/table/avlrfoff.cpp \
    296297        common/table/avlu32.cpp \
    297298        common/table/avluintptr.cpp \
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