From 25a21072beb9e64a8ac366e218551e78560739cd Mon Sep 17 00:00:00 2001 From: Ruslan Mustakov Date: Sat, 29 Jul 2017 22:00:21 +0700 Subject: [PATCH] Move alloc procs to godotinternal module --- godot/core/godotbase.nim | 17 ----------------- godot/godotinternal.nim | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/godot/core/godotbase.nim b/godot/core/godotbase.nim index f2fcd53..0fda0cd 100644 --- a/godot/core/godotbase.nim +++ b/godot/core/godotbase.nim @@ -83,20 +83,3 @@ proc stepify*(value, step: float32): float32 = floor(value / step + 0.5'f32) * step else: 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. diff --git a/godot/godotinternal.nim b/godot/godotinternal.nim index f2652ec..0ec3959 100644 --- a/godot/godotinternal.nim +++ b/godot/godotinternal.nim @@ -269,3 +269,20 @@ proc getClassName*(o: ptr GodotObject): string = if result.len > 2 and result[^2] == 'S' and result[^1] == 'W': # There are physics type not known by ClassDB 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.