1
0
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:
Lukas Tenbrink
2025-03-14 15:15:09 +01:00
parent db66343528
commit 3207066e19
8 changed files with 32 additions and 47 deletions

View File

@@ -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;
}