I use 'malloc()' to allocate memory for a structure in C language. Part of the structure is as below:
struct f2fs_sb_info {
struct f2fs_fsck *fsck;
struct f2fs_super_block *raw_super;
struct f2fs_nm_info *nm_info;
struct f2fs_sm_info *sm_info;
struct f2fs_checkpoint *ckpt;
};
I find that the value of raw_super is always zero, while the value of ckpt is always 0x40000050.
I know that malloc() will not initialize the allocated memory. So the allocated memory should has random value. But the value of ckpt is always 0x40000050 and does not change every time I run the program. Why?
Allocated memory can store any value after allocation, but it does not have to be random - allocation is not random generator at all.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With