Is there a way to create a memory block in such a way that access outside the extent of that block will be guaranteed to hit a memory access (or protection) violation.
For example suppose I wanted to do some fairly heavy processing on an array of data but would prefer to let the hardware handle the bounds checking for me, can it be done?
e.g. in the following code snippet how would I go about constucting the array 'v', so that referencing element 2049 trips a hardware exception of some kind?
BYTE* p = v;