单片机malloc一个结构体,但是对结构体成员赋值时就报错了,用的是正点原子写的malloc,大佬们,这是啥原因呢
` typedef struct
{
u8 hh;
u32 jj;
}MyStruct_tamp_t;
typedef struct
{
u8 yy;
MyStruct_tamp_t tamp;
}MyStruct;
MyStruct* buff;
u8 *p;
p = (MyStruct*)mymalloc(sizeof(MyStruct));
printf("mymalloc size %d\n", sizeof(MyStruct));
printf("mem_perused: %d\n", mem_perused());
buff = p;
if (buff != NULL)
{
buff->yy = 5;
buff->tamp.hh = 1;
myfree(buff);
}`