summaryrefslogtreecommitdiff
path: root/gnulib/doc/posix-functions/malloc.texi
blob: 36edb52de8a950bee1e65f20c548b1c336f657c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
@node malloc
@section @code{malloc}
@findex malloc

POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/malloc.html}

Gnulib module: malloc-posix

Portability problems fixed by Gnulib:
@itemize
@item
Upon failure, the function does not set @code{errno} to @code{ENOMEM} on
some platforms:
mingw, MSVC 9.
@end itemize

Portability problems not fixed by Gnulib:
@itemize
@item @code{malloc (0)} always returns a NULL pointer on some platforms:
AIX 5.1, OSF/1 5.1.
@end itemize

Extension: Gnulib provides a module @samp{malloc-gnu} that substitutes a
@code{malloc} implementation that behaves more like the glibc implementation,
regarding the result of @code{malloc (0)}.