Skip to content

Commit b847b11

Browse files
committed
stress-jpeg: add alignment hint on rgb data
rgb data is page aligned, so hinting the pointer to be 4 byte aligned for uint32_t pointer operations is a suitable optimization as pages are at least 4 bytes in size. Signed-off-by: Colin Ian King <[email protected]>
1 parent 17f090e commit b847b11

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

stress-jpeg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ static void OPTIMIZE3 stress_rgb_noise(
139139
{
140140
const int32_t size = x_max * y_max * 3;
141141
register int32_t i, n;
142-
register uint32_t *ptr32 = (uint32_t *)rgb;
142+
register uint32_t *ptr32 = (uint32_t *)shim_assume_aligned(rgb, 4);
143143
register uint8_t *ptr8;
144144

145145
n = size >> 2;

0 commit comments

Comments
 (0)