C++ Project Learning

FUSE based File System

Posted by Jiayi.Liu on January 22, 2020

FUSE Resources

C/C++ Operations

Terms

  • POD type : A Plain Old Data Structure in C++ is an aggregate class that contains only PODS as members, has no user-defined destructor, no user-defined copy assignment operator, and no nonstatic members of pointer-to-member type. A struct with no modifiers or methods is called a POD struct, which exists as a backwards compatible interface with C libraries as it is (supposedly) guaranteed to be laid out as though it were a C struct. See this question for more details. A struct is normally a POD type.

Memory Allocation

memset vs new vs malloc !

    malloc and new can actually allocate new memory space but memset can’t. memset can only assign value for every byte in a memory space, most likely it will assign 0s.

    The difference between malloc and new is that malloc won’t invoke constructor and destructor. So, malloc is mostly for POD types while new is for C++ style types.