VirtualBox

Changeset 73097 in vbox for trunk/src/VBox/Storage/ISCSI.cpp


Ignore:
Timestamp:
Jul 12, 2018 9:06:33 PM (6 years ago)
Author:
vboxsync
Message:

*: Made RT_UOFFSETOF, RT_OFFSETOF, RT_UOFFSETOF_ADD and RT_OFFSETOF_ADD work like builtin_offsetof() and require compile time resolvable requests, adding RT_UOFFSETOF_DYN for the dynamic questions that can only be answered at runtime.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Storage/ISCSI.cpp

    r69500 r73097  
    27722772     */
    27732773    size_t cI2TSegs = 2*(pScsiReq->cI2TSegs + 1);
    2774     pIScsiPDU = (PISCSIPDUTX)RTMemAllocZ(RT_OFFSETOF(ISCSIPDUTX, aISCSIReq[cI2TSegs]));
     2774    pIScsiPDU = (PISCSIPDUTX)RTMemAllocZ(RT_UOFFSETOF_DYN(ISCSIPDUTX, aISCSIReq[cI2TSegs]));
    27752775    if (!pIScsiPDU)
    27762776        return VERR_NO_MEMORY;
     
    48364836    Assert(cbSegs == cbToRead);
    48374837
    4838     PSCSIREQ pReq = (PSCSIREQ)RTMemAllocZ(RT_OFFSETOF(SCSIREQ, aSegs[cT2ISegs]));
     4838    PSCSIREQ pReq = (PSCSIREQ)RTMemAllocZ(RT_UOFFSETOF_DYN(SCSIREQ, aSegs[cT2ISegs]));
    48394839    if (RT_LIKELY(pReq))
    48404840    {
     
    49634963    Assert(cbSegs == cbToWrite);
    49644964
    4965     PSCSIREQ pReq = (PSCSIREQ)RTMemAllocZ(RT_OFFSETOF(SCSIREQ, aSegs[cI2TSegs]));
     4965    PSCSIREQ pReq = (PSCSIREQ)RTMemAllocZ(RT_UOFFSETOF_DYN(SCSIREQ, aSegs[cI2TSegs]));
    49664966    if (RT_LIKELY(pReq))
    49674967    {
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