Hi all,
Quoting <http://llvm.org/docs/LangRef.html#i_malloc>:
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
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