What is a contiguous memory block?

This is a contiguous memory block of five bytes, spanning from location 1 to location 5:

alt text

It represents bytes (colored light blue) that are together in memory with no gap bytes (white) between them.

This is a non-contiguous set of five bytes of interest:

alt text

It is fragmented into three groups of bytes (colored yellow) with gap bytes at locations 4 and 6. Starting at location 1 there is a contiguous block of three bytes, spanning from locations 1 to 3. There are two more blocks of one byte each at locations 5 and 7, respectively.

The unused block at location 0 as well as any subsequent blocks beyond location 7 can usually be ignored since they do interpose between the bytes of interest spanning from locations 1 to 7.

Leave a Comment