function mloadTest1() public pure returns(bytes memory) {
bytes memory a;
assembly {
a :=mload(0x40)
}
return a; // 0x20
}
function mloadTest2() public pure returns(bytes32) {
bytes32 a;
assembly {
a := mload(0x40)
}
return a; // 0x80
}
mload(x) is a Yul code that reads 32 bytes from offset x in memory. And Solidity defaults to free memory points from 0x00 to 0x60, with 0x80 stored at 0x40.
I ran the code in two cases. I thought bytes memory a would return 0x80 (free memory point), but it returns 0x20. bytes32 a returns 0x80 as normal.