vlib: change byte to u8 (#19930)

This commit is contained in:
Kim Shrier 2023-11-18 18:23:32 -07:00 committed by GitHub
parent 53e1e5e686
commit cc220e60a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 39 additions and 45 deletions

View file

@ -11,7 +11,7 @@ pub fn mm_pages(size u64) u32 {
return u32(pages)
}
pub fn mm_alloc(size u64) (&byte, Errno) {
pub fn mm_alloc(size u64) (&u8, Errno) {
pages := mm_pages(size)
n_bytes := u64(pages * u32(Linux_mem.page_size))
@ -24,7 +24,7 @@ pub fn mm_alloc(size u64) (&byte, Errno) {
return &u8(0), e
}
pub fn mm_free(addr &byte) Errno {
pub fn mm_free(addr &u8) Errno {
ap := &int(addr - 4)
size := u64(*ap) * u64(Linux_mem.page_size)
@ -41,7 +41,7 @@ pub fn mem_copy(dest0 voidptr, src0 voidptr, n isize) voidptr {
}
@[unsafe]
pub fn malloc(n isize) &byte {
pub fn malloc(n isize) &u8 {
if n < 0 {
panic('malloc(<0)')
}