#Initializing pages allocated by uefi.allocatePages

1 messages · Page 1 of 1 (latest)

dry sage
#

so i'm trying to initialize pages allocated by std.uefi.boot_services.allocatePages and i'm stumbling upon the cannot memset const pointer error when i try to memset it
it returns [] align(4096) std.uefi.Page, which in turn are just [4096]u8, and i'm wondering how i can write to it?
i'm trying to do slicing syntax currently @memset(page[0..@sizeOf(std.uefi.Page)],0)
i suppose i could constCast but i feel like that's not the best way to do it

celest mauve
#

Is the variable const

const x = &.{1,2,3}; becomes const you need var to memset it

dry sage
#

figured it out, i needed to use |*page| syntax in my for loop capture, otherwise the for loop implicitly copied it which is.. interesting