X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=java_strings.py;h=5654a3dd5295d64d81484664f33116696f41fb9b;hb=f3429b633e5cfc7b04d92bdd3eed70534971b2bf;hp=1d28d0d1007e0a12acbc9cf9e792a9603ef910dc;hpb=886f4905d378c4225cbf13d53f073022fbb5acbc;p=ldk-java diff --git a/java_strings.py b/java_strings.py index 1d28d0d1..5654a3dd 100644 --- a/java_strings.py +++ b/java_strings.py @@ -115,7 +115,7 @@ import java.util.LinkedList; class CommonBase { long ptr; LinkedList ptrs_to = new LinkedList(); - protected CommonBase(long ptr) { assert ptr < 0 || ptr > 1024; this.ptr = ptr; } + protected CommonBase(long ptr) { assert ptr < 0 || ptr > 4096; this.ptr = ptr; } } """ @@ -161,7 +161,7 @@ void __attribute__((constructor)) spawn_stderr_redirection() { if not DEBUG or sys.platform == "darwin": self.c_file_pfx = self.c_file_pfx + """#define MALLOC(a, _) malloc(a) -#define FREE(p) if ((uint64_t)(p) > 1024) { free(p); } +#define FREE(p) if ((uint64_t)(p) > 4096) { free(p); } #define CHECK_ACCESS(p) """ if not DEBUG: @@ -298,7 +298,7 @@ static void alloc_freed(void* ptr) { __real_free(it); } static void FREE(void* ptr) { - if ((uint64_t)ptr < 1024) return; // Rust loves to create pointers to the NULL page for dummys + if ((uint64_t)ptr <= 4096) return; // Rust loves to create pointers to the NULL page for dummys alloc_freed(ptr); __real_free(ptr); } @@ -1277,7 +1277,7 @@ import javax.annotation.Nullable; out_java_struct += (info.arg_name) out_java_struct += (");\n") if return_type_info.java_ty == "long" and return_type_info.java_hu_ty != "long": - out_java_struct += "\t\tif (ret >= 0 && ret < 1024) { return null; }\n" + out_java_struct += "\t\tif (ret >= 0 && ret <= 4096) { return null; }\n" if return_type_info.to_hu_conv is not None: if not takes_self: