VirtualBox

Changeset 20360 in vbox for trunk


Ignore:
Timestamp:
Jun 8, 2009 12:04:31 AM (16 years ago)
Author:
vboxsync
Message:

IPRT: Memory pool (untested) and string pool stub implementation.

Location:
trunk
Files:
4 added
6 edited

Legend:

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

    r13832 r20360  
    146146
    147147/**
    148  * Free memory related to an virtual machine
     148 * Frees memory.
    149149 *
    150150 * @param   pv      Pointer to memory block.
     
    159159 * @param   cb      Size in bytes of the memory block to allocate.
    160160 */
    161 RTDECL(void *)    RTMemExecAlloc(size_t cb) RT_NO_THROW;
     161RTDECL(void *)  RTMemExecAlloc(size_t cb) RT_NO_THROW;
    162162
    163163/**
     
    166166 * @param   pv      Pointer to memory block.
    167167 */
    168 RTDECL(void)      RTMemExecFree(void *pv) RT_NO_THROW;
     168RTDECL(void)    RTMemExecFree(void *pv) RT_NO_THROW;
    169169
    170170#if defined(IN_RING0) && defined(RT_ARCH_AMD64) && defined(RT_OS_LINUX)
  • trunk/include/iprt/types.h

    r19559 r20360  
    12041204#define NIL_RTDBGMOD                                ((RTDBGMOD)0)
    12051205
     1206/** Memory pool handle. */
     1207typedef R3R0PTRTYPE(struct RTMEMPOOLINT *)          RTMEMPOOL;
     1208/** Pointer to a memory pool handle. */
     1209typedef RTMEMPOOL                                  *PRTMEMPOOL;
     1210/** NIL memory pool handle. */
     1211#define NIL_RTMEMPOOL                               ((RTMEMPOOL)0)
     1212/** The default memory pool handle. */
     1213#define RTMEMPOOL_DEFAULT                           ((RTMEMPOOL)-2)
     1214
     1215/** String cache handle. */
     1216typedef R3R0PTRTYPE(struct RTSTRCACHEINT *)         RTSTRCACHE;
     1217/** Pointer to a string cache handle. */
     1218typedef RTSTRCACHE                                 *PRTSTRCACHE;
     1219/** NIL string cache handle. */
     1220#define NIL_RTSTRCACHE                              ((RTSTRCACHE)0)
     1221/** The default string cache handle. */
     1222#define RTSTRCACHE_DEFAULT                          ((RTSTRCACHE)-2)
     1223
    12061224
    12071225/**
  • trunk/src/VBox/Runtime/Makefile.kmk

    r20355 r20360  
    287287        generic/RTLogWriteUser-generic.cpp \
    288288        generic/RTTimerLRCreate-generic.cpp \
     289        generic/mempool-generic.cpp \
    289290        generic/semfastmutex-generic.cpp \
    290291        generic/spinlock-generic.cpp \
     292        generic/strcache-stubs-generic.cpp \
    291293        generic/timerlr-generic.cpp \
    292294        r3/alloc-ef.cpp \
  • trunk/src/VBox/Runtime/common/dbg/dbgmod.cpp

    r20356 r20360  
    142142
    143143
     144/**
     145 * Creates a module based on the default debug info container.
     146 *
     147 * This can be used to manually load a module and its symbol.
     148 *
     149 * @returns IPRT status code.
     150 *
     151 * @param   phDbgMod        Where to return the module handle.
     152 * @param   pszName         The name of the module (mandatory).
     153 * @param   cb              The size of the module. Must be greater than zero.
     154 * @param   fFlags          Flags reserved for future extensions, MBZ for now.
     155 */
    144156RTDECL(int)  RTDbgModCreate(PRTDBGMOD phDbgMod, const char *pszName, RTUINTPTR cb, uint32_t fFlags)
    145157{
  • trunk/src/VBox/Runtime/common/dbg/dbgmodcontainer.cpp

    r20356 r20360  
    152152
    153153/**
    154  * Creates a
     154 * Creates a generic debug info container and associates it with the module.
    155155 *
    156156 * @returns IPRT status code.
  • trunk/src/VBox/Runtime/include/internal/magics.h

    r19509 r20360  
    6969/** Dead magic number for RTMEMCACHEINT::u32Magic. */
    7070#define RTMEMCACHE_MAGIC_DEAD       0x20080305
     71/** The magic value for RTMEMPOOL::u32Magic. (Jane Austin) */
     72#define RTMEMPOOL_MAGIC             0x17751216
     73/** The magic value for RTMEMPOOL::u32Magic after RTMemPoolDestroy. */
     74#define RTMEMPOOL_MAGIC_DEAD        0x18170718
    7175/** Magic number for heap blocks. (Edgar Allan Poe) */
    7276#define RTMEMHDR_MAGIC              0x18090119
     
    9195/** Magic value for RTSPINLOCKINTERNAL::u32Magic. (Terry Pratchett) */
    9296#define RTSPINLOCK_MAGIC            0x19480428
     97/** Magic value for RTSTRCACHE::u32Magic. (Sir Arthur Charles Clarke) */
     98#define RTSTRCACHE_MAGIC            0x19171216
     99/** Magic value for RTSTRCACHE::u32Magic after RTStrCacheDestroy. */
     100#define RTSTRCACHE_MAGIC_DEAD       0x20080319
    93101/** The value of RTSTREAM::u32Magic for a valid stream. */
    94102#define RTSTREAM_MAGIC              0xe44e44ee
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