mirror of
https://github.com/vlang/v.git
synced 2025-09-15 07:22:27 +03:00
all: voidptr(0) => unsafe { nil } (p.2)
This commit is contained in:
parent
1f25811786
commit
dc79f1392b
8 changed files with 32 additions and 32 deletions
|
@ -139,7 +139,7 @@ fn (mut a array) ensure_cap(required int) {
|
|||
}
|
||||
new_size := u64(cap) * u64(a.element_size)
|
||||
new_data := unsafe { malloc(new_size) }
|
||||
if a.data != voidptr(0) {
|
||||
if a.data != unsafe { nil } {
|
||||
unsafe { vmemcpy(new_data, a.data, u64(a.len) * u64(a.element_size)) }
|
||||
// TODO: the old data may be leaked when no GC is used (ref-counting?)
|
||||
if a.flags.has(.noslices) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue