VirtualBox

vbox的更動 36372 路徑 trunk/src/VBox/Runtime/r0drv


忽略:
時間撮記:
2011-3-23 下午04:35:01 (14 年 以前)
作者:
vboxsync
訊息:

RTR0MemObjSize: Correct documentation and added alignment guarantee.

檔案:
修改 1 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Runtime/r0drv/memobj-r0drv.cpp

    r33540 r36372  
    6464    Assert(cbSelf >= sizeof(*pNew));
    6565    Assert(cbSelf == (uint32_t)cbSelf);
     66    AssertMsg(RT_ALIGN_Z(cb, PAGE_SIZE) == cb, ("%#zx\n", pMem->cb));
    6667
    6768    /*
     
    226227 * Gets the size of a ring-0 memory object.
    227228 *
    228  * @returns The address of the memory object.
     229 * The returned value may differ from the one specified to the API creating the
     230 * object because of alignment adjustments.  The minimal alignment currently
     231 * employed by any API is PAGE_SIZE, so the result can safely be shifted by
     232 * PAGE_SHIFT to calculate a page count.
     233 *
     234 * @returns The object size.
    229235 * @returns 0 if the handle is invalid (asserts in strict builds) or if there isn't any mapping.
    230236 * @param   MemObj  The ring-0 memory object handle.
     
    241247    AssertMsgReturn(pMem->u32Magic == RTR0MEMOBJ_MAGIC, ("%p: %#x\n", pMem, pMem->u32Magic), 0);
    242248    AssertMsgReturn(pMem->enmType > RTR0MEMOBJTYPE_INVALID && pMem->enmType < RTR0MEMOBJTYPE_END, ("%p: %d\n", pMem, pMem->enmType), 0);
     249    AssertMsg(RT_ALIGN_Z(pMem->cb, PAGE_SIZE) == pMem->cb, ("%#zx\n", pMem->cb));
    243250
    244251    /* return the size. */
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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