HDF5 specs fractal heap confusion: Maximum Heap Size


In the specification of the fractal heap we have two statements that are confusing:

  1. The number of bytes used to encode this field is the Maximum Heap Size (in the heap’s header) divided by 8 and rounded up to the next highest integer, for values that are not a multiple of 8.
  2. This field’s size is the minimum number of bytes necessary to encode the Maximum Heap Size value (from the Fractal Heap Header). For example, if the value of the Maximum Heap Size is less than 256 bytes, this field is 1 byte in length, a Maximum Heap Size of 256-65535 bytes uses a 2 byte length, and so on.

In the first case Maximum Heap Size refers to the actual value stored in the header (e.g. 32) while in the second case Maximum Heap Size refers to the actual heap size in bytes (e.g. 65536). Maybe this can be cleaned up, I definitely stumbled on this.