class CommonBase {
long ptr;
LinkedList<Object> ptrs_to = new LinkedList();
- protected CommonBase(long ptr) { assert ptr > 1024; this.ptr = ptr; }
+ protected CommonBase(long ptr) { assert ptr < 0 || ptr > 1024; this.ptr = ptr; }
}
"""
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 < 1024) { return null; }\n"
+ out_java_struct += "\t\tif (ret >= 0 && ret < 1024) { return null; }\n"
if return_type_info.to_hu_conv is not None:
if not takes_self:
void free(void *ptr);
#define MALLOC(a, _) malloc(a)
-#define FREE(p) if ((long)(p) > 1024) { free(p); }
+#define FREE(p) if ((unsigned long)(p) > 1024) { free(p); }
#define DO_ASSERT(a) (void)(a)
#define CHECK(a)
"""
__real_free(it);
}
static void FREE(void* ptr) {
- if ((long)ptr < 1024) return; // Rust loves to create pointers to the NULL page for dummys
+ if ((unsigned long)ptr < 1024) return; // Rust loves to create pointers to the NULL page for dummys
alloc_freed(ptr);
__real_free(ptr);
}