Move alloc procs to godotinternal module
This commit is contained in:
parent
360be5759e
commit
25a21072be
2 changed files with 17 additions and 17 deletions
|
|
@ -83,20 +83,3 @@ proc stepify*(value, step: float32): float32 =
|
||||||
floor(value / step + 0.5'f32) * step
|
floor(value / step + 0.5'f32) * step
|
||||||
else:
|
else:
|
||||||
value
|
value
|
||||||
|
|
||||||
# System Functions
|
|
||||||
|
|
||||||
proc godotAlloc*(bytes: cint): pointer {.
|
|
||||||
importc: "godot_alloc".}
|
|
||||||
## Allocates the specified number of bytes.
|
|
||||||
## Using this instead of stdlib proc will help Godot track how much memory
|
|
||||||
## is in use in debug mode.
|
|
||||||
proc godotRealloc*(p: pointer; bytes: cint): pointer {.
|
|
||||||
importc: "godot_realloc".}
|
|
||||||
## Reallocates the pointer for the specified number of bytes.
|
|
||||||
## Using this instead of stdlib proc will help Godot track how much memory
|
|
||||||
## is in use in debug mode.
|
|
||||||
proc godotFree*(p: pointer) {.importc: "godot_free".}
|
|
||||||
## Frees the memory pointed to by the pointer.
|
|
||||||
## Using this instead of stdlib proc will help Godot track how much memory
|
|
||||||
## is in use in debug mode.
|
|
||||||
|
|
|
||||||
|
|
@ -269,3 +269,20 @@ proc getClassName*(o: ptr GodotObject): string =
|
||||||
if result.len > 2 and result[^2] == 'S' and result[^1] == 'W':
|
if result.len > 2 and result[^2] == 'S' and result[^1] == 'W':
|
||||||
# There are physics type not known by ClassDB
|
# There are physics type not known by ClassDB
|
||||||
result = result[0..result.len-3]
|
result = result[0..result.len-3]
|
||||||
|
|
||||||
|
# System Functions
|
||||||
|
|
||||||
|
proc godotAlloc*(bytes: cint): pointer {.
|
||||||
|
importc: "godot_alloc".}
|
||||||
|
## Allocates the specified number of bytes.
|
||||||
|
## Using this instead of stdlib proc will help Godot track how much memory
|
||||||
|
## is in use in debug mode.
|
||||||
|
proc godotRealloc*(p: pointer; bytes: cint): pointer {.
|
||||||
|
importc: "godot_realloc".}
|
||||||
|
## Reallocates the pointer for the specified number of bytes.
|
||||||
|
## Using this instead of stdlib proc will help Godot track how much memory
|
||||||
|
## is in use in debug mode.
|
||||||
|
proc godotFree*(p: pointer) {.importc: "godot_free".}
|
||||||
|
## Frees the memory pointed to by the pointer.
|
||||||
|
## Using this instead of stdlib proc will help Godot track how much memory
|
||||||
|
## is in use in debug mode.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue