import org.ldk.enums.*;
import org.ldk.util.*;
import java.util.Arrays;
+import java.lang.ref.Reference;
import javax.annotation.Nullable;
*/
public InitFeatures get_features() {
long ret = bindings.Init_get_features(this.ptr);
- if (ret < 1024) { return null; }
- InitFeatures ret_hu_conv = new InitFeatures(null, ret);
+ Reference.reachabilityFence(this);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ InitFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InitFeatures(null, ret); }
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
}
*/
public void set_features(InitFeatures val) {
bindings.Init_set_features(this.ptr, val == null ? 0 : val.ptr & ~1);
+ Reference.reachabilityFence(this);
+ Reference.reachabilityFence(val);
}
/**
*/
public static Init of(InitFeatures features_arg) {
long ret = bindings.Init_new(features_arg == null ? 0 : features_arg.ptr & ~1);
- if (ret < 1024) { return null; }
- Init ret_hu_conv = new Init(null, ret);
+ Reference.reachabilityFence(features_arg);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Init ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Init(null, ret); }
ret_hu_conv.ptrs_to.add(ret_hu_conv);
return ret_hu_conv;
}
+ long clone_ptr() {
+ long ret = bindings.Init_clone_ptr(this.ptr);
+ Reference.reachabilityFence(this);
+ return ret;
+ }
+
/**
* Creates a copy of the Init
*/
public Init clone() {
long ret = bindings.Init_clone(this.ptr);
- if (ret < 1024) { return null; }
- Init ret_hu_conv = new Init(null, ret);
+ Reference.reachabilityFence(this);
+ if (ret >= 0 && ret <= 4096) { return null; }
+ Init ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Init(null, ret); }
ret_hu_conv.ptrs_to.add(this);
return ret_hu_conv;
}
*/
public byte[] write() {
byte[] ret = bindings.Init_write(this.ptr);
+ Reference.reachabilityFence(this);
return ret;
}
*/
public static Result_InitDecodeErrorZ read(byte[] ser) {
long ret = bindings.Init_read(ser);
- if (ret < 1024) { return null; }
+ Reference.reachabilityFence(ser);
+ if (ret >= 0 && ret <= 4096) { return null; }
Result_InitDecodeErrorZ ret_hu_conv = Result_InitDecodeErrorZ.constr_from_ptr(ret);
return ret_hu_conv;
}