mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +00:00
os: Remove deprecated malloc/free wrappers
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
48
os/utils.c
48
os/utils.c
@@ -1089,24 +1089,6 @@ set_font_authorizations(char **authorizations, int *authlen, void *client)
|
||||
#endif /* TCPCONN */
|
||||
}
|
||||
|
||||
void *
|
||||
Xalloc(unsigned long amount)
|
||||
{
|
||||
/*
|
||||
* Xalloc used to return NULL when large amount of memory is requested. In
|
||||
* order to catch the buggy callers this warning has been added, slated to
|
||||
* removal by anyone who touches this code (or just looks at it) in 2011.
|
||||
*
|
||||
* -- Mikhail Gusarov
|
||||
*/
|
||||
if ((long) amount <= 0)
|
||||
ErrorF("Warning: Xalloc: "
|
||||
"requesting unpleasantly large amount of memory: %lu bytes.\n",
|
||||
amount);
|
||||
|
||||
return malloc(amount);
|
||||
}
|
||||
|
||||
void *
|
||||
XNFalloc(unsigned long amount)
|
||||
{
|
||||
@@ -1117,12 +1099,6 @@ XNFalloc(unsigned long amount)
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void *
|
||||
Xcalloc(unsigned long amount)
|
||||
{
|
||||
return calloc(1, amount);
|
||||
}
|
||||
|
||||
void *
|
||||
XNFcalloc(unsigned long amount)
|
||||
{
|
||||
@@ -1133,24 +1109,6 @@ XNFcalloc(unsigned long amount)
|
||||
return ret;
|
||||
}
|
||||
|
||||
void *
|
||||
Xrealloc(void *ptr, unsigned long amount)
|
||||
{
|
||||
/*
|
||||
* Xrealloc used to return NULL when large amount of memory is requested. In
|
||||
* order to catch the buggy callers this warning has been added, slated to
|
||||
* removal by anyone who touches this code (or just looks at it) in 2011.
|
||||
*
|
||||
* -- Mikhail Gusarov
|
||||
*/
|
||||
if ((long) amount <= 0)
|
||||
ErrorF("Warning: Xrealloc: "
|
||||
"requesting unpleasantly large amount of memory: %lu bytes.\n",
|
||||
amount);
|
||||
|
||||
return realloc(ptr, amount);
|
||||
}
|
||||
|
||||
void *
|
||||
XNFrealloc(void *ptr, unsigned long amount)
|
||||
{
|
||||
@@ -1161,12 +1119,6 @@ XNFrealloc(void *ptr, unsigned long amount)
|
||||
return ret;
|
||||
}
|
||||
|
||||
void
|
||||
Xfree(void *ptr)
|
||||
{
|
||||
free(ptr);
|
||||
}
|
||||
|
||||
char *
|
||||
Xstrdup(const char *s)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user