Xserver-spec: Update Memory Management functions

Xalloc, Xrealloc, & Xfree are deprecated now
ALLOCATE_LOCAL is removed due to stack overflow issues

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
This commit is contained in:
Alan Coopersmith 2010-11-27 00:14:51 -08:00
parent 02449ee24b
commit 922806a5aa
1 changed files with 3 additions and 11 deletions

View File

@ -1215,20 +1215,12 @@ library is contained in dix/dixfonts.c
<title>Memory Management</title>
<para>
Memory management is based on functions in the C runtime library.
Xalloc(), Xrealloc(), and Xfree() work just like malloc(), realloc(),
and free(), except that you can pass a null pointer to Xrealloc() to
have it allocate anew or pass a null pointer to Xfree() and nothing
will happen. The versions in the sample server also do some checking
that is useful for debugging. Consult a C runtime library reference
Xalloc(), Xrealloc(), and Xfree() are deprecated aliases for malloc(),
realloc(), and free(), and you should simply call the C library functions
directly. Consult a C runtime library reference
manual for more details.
</para>
<para>
The macros ALLOCATE_LOCAL and DEALLOCATE_LOCAL are provided in
Xserver/include/os.h. These are useful if your compiler supports
alloca() (or some method of allocating memory from the stack); and are
defined appropriately on systems which support it.
</para>
<para>
Treat memory allocation carefully in your implementation. Memory
leaks can be very hard to find and are frustrating to a user. An X
server could be running for days or weeks without being reset, just