Bug 252858 - calloc manual page has become useless
Summary: calloc manual page has become useless
Status: Closed Not A Bug
Alias: None
Product: Documentation
Classification: Unclassified
Component: Manual Pages (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-20 11:16 UTC by Ben Bullock
Modified: 2021-01-22 14:31 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Bullock 2021-01-20 11:16:05 UTC
The manual page for calloc and friends spends lots of time blathering on about how great jemalloc is and very little time actually documenting what calloc does. For example, it does not actually say what the return value of calloc might be if given arguments of zero.

The old manual pages for calloc and malloc on FreeBSD were quite good, yet they have been replaced with the Jason Evans advertising in the guise of a manual page.

Please either make Jason Evans at least document what calloc does or replace the current jemalloc drivel with the proper documentation that used to exist.
Comment 1 Conrad Meyer freebsd_committer freebsd_triage 2021-01-22 14:31:44 UTC
jemalloc has been standard in FreeBSD for like, more than a decade?  This is not new.  http://rapid-shield.com/releases/7.0R/relnotes.html

It's not quite a canonical manual page but it's not as poor as you make it out:

       The calloc() function allocates space for number objects, each size
       bytes in length. The result is identical to calling malloc() with an
       argument of number * size, with the exception that the allocated memory
       is explicitly initialized to zero bytes.

Ok, so it does what malloc does for zero byte requests:

       The malloc() function allocates size bytes of uninitialized memory. The
       allocated space is suitably aligned (after possible pointer coercion)
       for storage of any type of object.

Ok, so you can store any 0-byte object you want at the return value of malloc(0).