<分区>
void env_create(uint8_t *binary, enum EnvType type){
struct Env *env = NULL;
int r = env_alloc(&env, 0); // &env = 0xf0117fcc
cprintf("env addr: %x\n", &env); // &env = 0xf0117fbc
if(r != 0) panic("env_create:%e", r);
load_icode(env, binary); // &env = 0xf0117fcc
env->env_type = type;
}
当我用gdb检查“env”的地址时,它总是0xf0117fcc,但调用“env_alloc”后“env”的正确值存储在0xf0117fbc。我想知道可能导致问题的原因是什么?提前致谢。