grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Eliminating grub_size_t


From: Pavel Roskin
Subject: Eliminating grub_size_t
Date: Tue, 01 Jul 2008 22:14:40 -0400

Hello!

I wonder if we would be better off without grub_size_t.  I cannot think
of any code that could use it legitimately.

The ordinary size_t is used to represent the result of sizeof, i.e. size
of a structure.  There is no need for grub to support data structures
exceeding 4 gigabytes.  If we want to support more memory, that's fine,
but that would involve other types that can hold the pointer values,
such as long.

size_t has different size on 32-bit and 64-bit systems, but we should
strive to make the userspace utilities work like the bootloader, so that
possible problems can be detected early and debugged easily.

Besides, we cannot even print size_t in grub_printf(), and I don't think
we should.

grub_size_t should be replaced with int or grub_uint32_t.  size_t can be
used in pure userspace code to call functions that need it.

-- 
Regards,
Pavel Roskin




reply via email to

[Prev in Thread] Current Thread [Next in Thread]