mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
builtin: make v_realloc use int parameter instead of u32 (#7080)
This commit is contained in:
@ -171,10 +171,10 @@ TODO
|
||||
//fn malloc_size(b byteptr) int
|
||||
|
||||
[unsafe]
|
||||
pub fn v_realloc(b byteptr, n u32) byteptr {
|
||||
pub fn v_realloc(b byteptr, n int) byteptr {
|
||||
$if prealloc {
|
||||
unsafe {
|
||||
new_ptr := malloc(int(n))
|
||||
new_ptr := malloc(n)
|
||||
size := 0 //malloc_size(b)
|
||||
C.memcpy(new_ptr, b, size)
|
||||
return new_ptr
|
||||
|
Reference in New Issue
Block a user