Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

8257566: Lanai: System runs out of application memory while running t…

…he Unmanaged_BufferredImage_draw_NearestNeighbor test multiple times
  • Loading branch information
aghaisas committed Dec 3, 2020
1 parent ca1296f commit 85fcedca4df096494851a47770bce9c78faf5b9e
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/java.desktop/macosx/native/libawt_lwawt/java2d/metal/MTLBlitLoops.m
@@ -172,7 +172,7 @@ void drawTex2Tex(MTLContext *mtlc,
dw, dh, dx1, dy1);
// NOTE: we might want to fill alpha channel when !rfi->hasAlpha

id<MTLBuffer> buff = [mtlc.device newBufferWithLength:(sw * sh * srcInfo->pixelStride) options:MTLResourceStorageModeManaged];
id<MTLBuffer> buff = [[mtlc.device newBufferWithLength:(sw * sh * srcInfo->pixelStride) options:MTLResourceStorageModeManaged] autorelease];

// copy src pixels inside src bounds to buff
for (int row = 0; row < sh; row++) {
@@ -182,7 +182,7 @@ void drawTex2Tex(MTLContext *mtlc,
[buff didModifyRange:NSMakeRange(0, buff.length)];

if (rfi->swizzleKernel != nil) {
id <MTLBuffer> swizzled = [mtlc.device newBufferWithLength:(sw * sh * srcInfo->pixelStride) options:MTLResourceStorageModeManaged];
id <MTLBuffer> swizzled = [[mtlc.device newBufferWithLength:(sw * sh * srcInfo->pixelStride) options:MTLResourceStorageModeManaged] autorelease];

// this should be cheap, since data is already on GPU
id<MTLCommandBuffer> cb = [mtlc createCommandBuffer];

0 comments on commit 85fcedc

Please sign in to comment.