⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 288507 in webkit


Ignore:
Timestamp:
Jan 24, 2022, 5:55:23 PM (5 years ago)
Author:
Russell Epstein
Message:

Cherry-pick r288074. rdar://problem/87653812

REGRESSION (r286603): Leak of three NSMutableDictionary objects each time rx::DisplayMtl::getMetalDeviceMatchingAttribute() is called
<​https://webkit.org/b/235278>
<rdar://problem/87653812>

Reviewed by Darin Adler.

  • src/libANGLE/renderer/metal/DisplayMtl.mm: (rx::DisplayMtl::getMetalDeviceMatchingAttribute):
  • Make use of mtl::adoptObjCObj<> so these objects are relaseed when the method returns.

git-svn-id: ​https://svn.webkit.org/repository/webkit/trunk@288074 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Location:
branches/safari-613-branch/Source/ThirdParty/ANGLE
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-613-branch/Source/ThirdParty/ANGLE/ChangeLog

    r288046 r288507  
     12022-01-24  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r288074. rdar://problem/87653812
     4
     5    REGRESSION (r286603): Leak of three NSMutableDictionary objects each time rx::DisplayMtl::getMetalDeviceMatchingAttribute() is called
     6    <https://webkit.org/b/235278>
     7    <rdar://problem/87653812>
     8   
     9    Reviewed by Darin Adler.
     10   
     11    * src/libANGLE/renderer/metal/DisplayMtl.mm:
     12    (rx::DisplayMtl::getMetalDeviceMatchingAttribute):
     13    - Make use of mtl::adoptObjCObj<> so these objects are relaseed
     14      when the method returns.
     15   
     16   
     17    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@288074 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     18
     19    2022-01-16  David Kilzer  <ddkilzer@apple.com>
     20
     21            REGRESSION (r286603): Leak of three NSMutableDictionary objects each time rx::DisplayMtl::getMetalDeviceMatchingAttribute() is called
     22            <https://webkit.org/b/235278>
     23            <rdar://problem/87653812>
     24
     25            Reviewed by Darin Adler.
     26
     27            * src/libANGLE/renderer/metal/DisplayMtl.mm:
     28            (rx::DisplayMtl::getMetalDeviceMatchingAttribute):
     29            - Make use of mtl::adoptObjCObj<> so these objects are relaseed
     30              when the method returns.
     31
    1322022-01-14  Russell Epstein  <repstein@apple.com>
    233
  • branches/safari-613-branch/Source/ThirdParty/ANGLE/src/libANGLE/renderer/metal/DisplayMtl.mm

    r288046 r288507  
    239239    auto deviceList = mtl::adoptObjCObj(MTLCopyAllDevices());
    240240
    241     NSMutableArray<id<MTLDevice>> *externalGPUs   = [[NSMutableArray alloc] init];
    242     NSMutableArray<id<MTLDevice>> *integratedGPUs = [[NSMutableArray alloc] init];
    243     NSMutableArray<id<MTLDevice>> *discreteGPUs   = [[NSMutableArray alloc] init];
     241    auto externalGPUs = mtl::adoptObjCObj<NSMutableArray<id<MTLDevice>>>([[NSMutableArray alloc] init]);
     242    auto integratedGPUs = mtl::adoptObjCObj<NSMutableArray<id<MTLDevice>>>([[NSMutableArray alloc] init]);
     243    auto discreteGPUs = mtl::adoptObjCObj<NSMutableArray<id<MTLDevice>>>([[NSMutableArray alloc] init]);
    244244    for (id<MTLDevice> device in deviceList.get())
    245245    {
    246246        if (device.removable)
    247247        {
    248             [externalGPUs addObject:device];
     248            [externalGPUs.get() addObject:device];
    249249        }
    250250        else if (device.lowPower)
    251251        {
    252             [integratedGPUs addObject:device];
     252            [integratedGPUs.get() addObject:device];
    253253        }
    254254        else
    255255        {
    256             [discreteGPUs addObject:device];
     256            [discreteGPUs.get() addObject:device];
    257257        }
    258258    }
    … …  
    263263    {
    264264        // Search for a discrete GPU first.
    265         for (id<MTLDevice> device in discreteGPUs)
     265        for (id<MTLDevice> device in discreteGPUs.get())
    266266        {
    267267            if (![device isHeadless])
    … …  
    272272    {
    273273        // If we've selected a low power device, look through integrated devices.
    274         for (id<MTLDevice> device in integratedGPUs)
     274        for (id<MTLDevice> device in integratedGPUs.get())
    275275        {
    276276            if (![device isHeadless])
    … …  
    296296
    297297    // Default to use a low power device, look through integrated devices.
    298     for (id<MTLDevice> device in integratedGPUs)
     298    for (id<MTLDevice> device in integratedGPUs.get())
    299299    {
    300300        if (![device isHeadless])
Note: See TracChangeset for help on using the changeset viewer.