kudl4t4 wrote on Friday, August 29, 2014:
My code looks like
/*------ VARIABLES ------*/
uint8_t how;
typedef struct {
uint8_t *nfcid;
} Test;
typedef union {
Test here;
} Haha;
Haha *haha;
/*------ FUNCTIONS ------*/
void memoryAlloc( Haha **haha ) {
Haha *h =(Haha *)pvPortMalloc( (1) * sizeof(Haha) );
*haha = h;
uint8_t *r =(uint8_t *)pvPortMalloc( (1) * sizeof(uint8_t) );
*r = 0x0F+how;
(*haha)->here.nfcid = r;
}
void freeAlloc( Haha *haha ) {
vPortFree(haha->tutaj.nfcid);
vPortFree(haha);
}
/*------ MAIN ------*/
void main() {
how++;
memoryAlloc(&haha);
freeAlloc(haha);
}
and it seems like vPortFree doesn’t free memory. What may be the problem?