Summary: public The classes `java.util.zip.{Inflater/Deflater}` where not modelled as resources. In practice, bad memory leak can happen using these classes and forcing the call to `end()` can help to avoid waisting native memory. Reviewed By: sblackshear Differential Revision: D2661249 fb-gh-sync-id: 1e33316master
parent
12e37c97fc
commit
930eaba2d5
@ -0,0 +1,32 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2013 - present Facebook, Inc.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the BSD style license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree. An additional grant
|
||||||
|
* of patent rights can be found in the PATENTS file in the same directory.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package java.util.zip;
|
||||||
|
|
||||||
|
import com.facebook.infer.models.InferBuiltins;
|
||||||
|
|
||||||
|
public class Deflater {
|
||||||
|
|
||||||
|
public Deflater() {
|
||||||
|
InferBuiltins.__set_file_attribute(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Deflater(int level) {
|
||||||
|
this();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Deflater(int level, boolean nowrap) {
|
||||||
|
this();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void end() {
|
||||||
|
InferBuiltins.__set_mem_attribute(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2013 - present Facebook, Inc.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the BSD style license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree. An additional grant
|
||||||
|
* of patent rights can be found in the PATENTS file in the same directory.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package java.util.zip;
|
||||||
|
|
||||||
|
import com.facebook.infer.models.InferBuiltins;
|
||||||
|
|
||||||
|
public class Inflater {
|
||||||
|
|
||||||
|
public Inflater() {
|
||||||
|
InferBuiltins.__set_file_attribute(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Inflater(boolean nowrap) {
|
||||||
|
this();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void end() {
|
||||||
|
InferBuiltins.__set_mem_attribute(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in new issue