[haiku-commits] Re: haiku: hrev45558 - in src: add-ons/kernel/bus_managers/pci system/kernel/vm system/boot/platform/bios_ia32 apps/icon-o-matic/generic/gui/panel/color_picker .

  • From: Jérôme Duval <korli@xxxxxxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 27 Apr 2013 14:00:53 +0200

2013/4/26 Ingo Weinhold <ingo_weinhold@xxxxxx>

> On 04/26/2013 09:20 PM, korli@xxxxxxxxxxxxxxxx wrote:  struct
> swap_hash_key {
>
>>         VMAnonymousCache        *cache;
>> -       off_t                           page_index;  // page index in the
>> cache
>> +       page_num_t                      page_index;  // page index in the
>> cache
>>   };
>>
>
> Unfortunately this (speaking of the whole commit) isn't quite correct. The
> data type page_num_t is meant to address physical pages. On a pure 32-bit
> platform it is only 32 bits wide (not on x86, due to PAE being built in),
> while the index type used for pages in the cache must be able to address
> pages in a file. 16 TiB files might seem a bit futuristic ATM, but should
> we ever get around to re-implementing the block cache on top of VMCache it
> will be about partition sizes.
>
> So, long story short: off_t is the correct type to use for addressing
> pages in a cache/file, which page_num_t should only be used for physical
> pages. The uint32's weren't correct in either case.
>
>  Thanks for the review! At least this clarify things for me, I'll revert
this commit. I'll try to fix the *signedness* warnings differently...

Bye,
Jérôme

Other related posts: