You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-24 15:26:15 +00:00
Add Memory::alloc_static_zeroed to allocate memory that's filled with zeroes.
This is generally faster than `malloc` followed by `memset` / loop-set to 0.
This commit is contained in:
@@ -161,8 +161,7 @@ int zipio_testerror(voidpf opaque, voidpf stream) {
|
||||
}
|
||||
|
||||
voidpf zipio_alloc(voidpf opaque, uInt items, uInt size) {
|
||||
voidpf ptr = memalloc((size_t)items * size);
|
||||
memset(ptr, 0, items * size);
|
||||
voidpf ptr = memalloc_zeroed((size_t)items * size);
|
||||
return ptr;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user