While reading a hacker article on the jemalloc memory manager, the hacker keeps referring to malloc(3), not malloc. I wondered why.
Does he do so because it refers to a specific linux malloc implementation? Or simply to refer to all malloc variants, that implement the interface as described on the section 3 (libary functions) of the unix/linux manual pages? This option is my guess, want to be sure. Is there a different reason?
So, is the hacker just overly specific? Or is there a difference between malloc and malloc(3)?
The (3) part is not a reference to other documentation, article or research mentioned later in the hacker article.
malloc(3)is just a hint thatmallocis a part of the section 3 of the man pages. The section 3 is where are the library functions. This is by opposition to the section 2 of the man pages where are the syscalls. There is nomalloc(2).For example:
fwriteis a library function so sometimes written asfwrite(3)writeis a syscall so sometimes written aswrite(2)If you run the command:
it will tell you