Name: Anonymous 2008-04-21 22:12
So I was browsing through some code today in a certain open source app. In particular, this code deleted an array called quant4_bias[i], with i going from 0 to 6. The array was an array of pointers, each which pointed to an array malloc'd on the heap. Simple enough. But I noticed that it didn't delete quant8_bias like it was supposed to. Yet it didn't memory leak... quite odd, one might say!
But then I noticed the declaration code in the struct where these arrays were kept:
uint16_t (*quant4_bias[4])[16];
uint16_t (*quant8_bias[2])[64];
>> (*quant4_bias[4])[16] <<
>> quant4_bias[4] <<
>> [4] <<
After the mindfuck finished, I finally realized... I SEE WHAT HE DID THERE.
But then I noticed the declaration code in the struct where these arrays were kept:
uint16_t (*quant4_bias[4])[16];
uint16_t (*quant8_bias[2])[64];
>> (*quant4_bias[4])[16] <<
>> quant4_bias[4] <<
>> [4] <<
After the mindfuck finished, I finally realized... I SEE WHAT HE DID THERE.