1
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
class Memory {
|
||||
|
||||
function alloc(Size) {
|
||||
return NativePointer(Size);
|
||||
return NativePointer(Size.tostring());
|
||||
}
|
||||
|
||||
function allocUtf8String(Str) {
|
||||
@@ -22,11 +22,13 @@ class NativePointer {
|
||||
|
||||
constructor(T) {
|
||||
if (type(T) == "integer") {
|
||||
C_Object = Sq_New_Point(T);
|
||||
//注册销毁伪析构
|
||||
Register_Destruction(C_Object, this);
|
||||
C_Object = L_sq_I2P(T);
|
||||
} else if (type(T) == "userdata") {
|
||||
C_Object = T;
|
||||
} else if (type(T) == "string") {
|
||||
C_Object = Sq_New_Point(T.tointeger());
|
||||
//注册销毁伪析构
|
||||
Register_Destruction(C_Object, this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,9 +117,6 @@ class NativePointer {
|
||||
|
||||
function read(type) {
|
||||
local Buf = Sq_Point2Blob(L_sq_P2I(this.C_Object), 4);
|
||||
foreach(value in Buf) {
|
||||
print(value);
|
||||
}
|
||||
return Buf.readn(type);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user