Imprecise description of malloc instruction

Hi all,

Quoting <http://llvm.org/docs/LangRef.html#i_malloc&gt;:

  The 'malloc' instruction allocates sizeof(<type>)*NumElements bytes of
  memory from the operating system and returns a pointer of the appropriate type
  to the program. If "NumElements" is specified, it is the number of elements allocated.

Obviously this does not say that the default for NumElements is one.
Even obvious assumptions should be *explicit* in a spec :slight_smile:

May I reword as:

  The 'malloc' instruction allocates sizeof(<type>)*NumElements bytes of
  memory from the operating system and returns a pointer of the appropriate type
  to the program. If "NumElements" is specified, it is the number of elements allocated,
  otherwise "NumElements" is defaulted to be one.

?

Cheers

  Gabor

Looks great, please do Gabor. The description for alloca also needs update probably.

Thanks!

-Chris