Open maxgerhardt opened 5 months ago
Fair point. Checks indeed need to be done on the original pointers. I shall fix these. And the removal of over-allocation too. That given, looks like you get a crash since, allocations are failing. Please use SPIRAM for the tests. The allocations needed for some tests are huge.
Consider
https://github.com/espressif/esp-nn/blob/34e97138de6e80ab6e047262c1c8b77514739a39/tests/src/convolution_test.c#L215-L229
If
input_orig = NULL = 0
, then,will compute
input = 16 + 0 - (0 & 0xf) = 16;
And since
16 != NULL
, this will not trigger theif(input == NULL)
check at all.You need to perform the null checks on the original data, not this weird 16 byte aligned value.
What I find also weird is how it clearly tries to do a 16-byte alignment, by adding at maximum 15 to the original pointer value, but the overallocation is by
+32
? Should that not need only 15 really, in the worst case that 15 bytes need to be skipped? If 16 bytes were needed to be skipped, it would already be 16-byte aligned.Not doing this correctly has lead to me hardcrashing.