diff options
Diffstat (limited to 'nuttx/graphics/nxsu')
-rw-r--r-- | nuttx/graphics/nxsu/nx_close.c | 6 | ||||
-rw-r--r-- | nuttx/graphics/nxsu/nx_open.c | 6 | ||||
-rw-r--r-- | nuttx/graphics/nxsu/nx_openwindow.c | 6 | ||||
-rw-r--r-- | nuttx/graphics/nxsu/nxfe.h | 6 | ||||
-rw-r--r-- | nuttx/graphics/nxsu/nxsu_constructwindow.c | 10 |
5 files changed, 21 insertions, 13 deletions
diff --git a/nuttx/graphics/nxsu/nx_close.c b/nuttx/graphics/nxsu/nx_close.c index b48a2fca2..c1b9d1537 100644 --- a/nuttx/graphics/nxsu/nx_close.c +++ b/nuttx/graphics/nxsu/nx_close.c @@ -1,7 +1,7 @@ /**************************************************************************** * graphics/nxsu/nx_close.c * - * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -42,7 +42,9 @@ #include <stdlib.h> #include <debug.h> +#include <nuttx/kmalloc.h> #include <nuttx/nx/nx.h> + #include "nxfe.h" /**************************************************************************** @@ -86,6 +88,6 @@ void nx_close(NXHANDLE handle) { - free(handle); + kfree(handle); } diff --git a/nuttx/graphics/nxsu/nx_open.c b/nuttx/graphics/nxsu/nx_open.c index 72a2db058..d8efcee41 100644 --- a/nuttx/graphics/nxsu/nx_open.c +++ b/nuttx/graphics/nxsu/nx_open.c @@ -1,7 +1,7 @@ /**************************************************************************** * graphics/nxsu/nx_open.c * - * Copyright (C) 2008-2010 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2010, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -45,7 +45,9 @@ #include <errno.h> #include <debug.h> +#include <nuttx/kmalloc.h> #include <nuttx/nx/nx.h> + #include "nxfe.h" /**************************************************************************** @@ -195,7 +197,7 @@ NXHANDLE nx_open(FAR NX_DRIVERTYPE *dev) /* Allocate the NX state structure */ - fe = (FAR struct nxfe_state_s *)zalloc(sizeof(struct nxfe_state_s)); + fe = (FAR struct nxfe_state_s *)kzalloc(sizeof(struct nxfe_state_s)); if (!fe) { errno = ENOMEM; diff --git a/nuttx/graphics/nxsu/nx_openwindow.c b/nuttx/graphics/nxsu/nx_openwindow.c index 64f4ed76d..b002f1566 100644 --- a/nuttx/graphics/nxsu/nx_openwindow.c +++ b/nuttx/graphics/nxsu/nx_openwindow.c @@ -1,7 +1,7 @@ /**************************************************************************** * graphics/nxsu/nx_openwindow.c * - * Copyright (C) 2008-2009, 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009, 2012-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -43,7 +43,9 @@ #include <errno.h> #include <debug.h> +#include <nuttx/kmalloc.h> #include <nuttx/nx/nx.h> + #include "nxfe.h" /**************************************************************************** @@ -103,7 +105,7 @@ NXWINDOW nx_openwindow(NXHANDLE handle, FAR const struct nx_callback_s *cb, /* Pre-allocate the window structure */ - wnd = (FAR struct nxbe_window_s *)zalloc(sizeof(struct nxbe_window_s)); + wnd = (FAR struct nxbe_window_s *)kzalloc(sizeof(struct nxbe_window_s)); if (!wnd) { errno = ENOMEM; diff --git a/nuttx/graphics/nxsu/nxfe.h b/nuttx/graphics/nxsu/nxfe.h index 528224fc1..40c310d1a 100644 --- a/nuttx/graphics/nxsu/nxfe.h +++ b/nuttx/graphics/nxsu/nxfe.h @@ -1,7 +1,7 @@ /**************************************************************************** * graphics/nxsu/nxfe.h * - * Copyright (C) 2008-2010 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2010, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -103,10 +103,10 @@ EXTERN const struct nx_callback_s g_bkgdcb; * inheritance: The caller's window structure may include extensions that * are not visible to NX. * - * NOTE: wnd must have been allocated using malloc() (or related allocators) + * NOTE: wnd must have been allocated using kmalloc() (or related allocators) * Once provided to nxfe_constructwindow() that memory is owned and managed * by NX. On certain error conditions or when the window is closed, NX will - * free() the window. + * free the window. * * Input Parameters: * handle - The handle returned by nx_connect diff --git a/nuttx/graphics/nxsu/nxsu_constructwindow.c b/nuttx/graphics/nxsu/nxsu_constructwindow.c index f812b3f83..194a62106 100644 --- a/nuttx/graphics/nxsu/nxsu_constructwindow.c +++ b/nuttx/graphics/nxsu/nxsu_constructwindow.c @@ -1,7 +1,7 @@ /**************************************************************************** * graphics/nxsu/nx_openwindow.c * - * Copyright (C) 2008-2009, 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009, 2012-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -43,7 +43,9 @@ #include <errno.h> #include <debug.h> +#include <nuttx/kmalloc.h> #include <nuttx/nx/nx.h> + #include "nxfe.h" /**************************************************************************** @@ -81,10 +83,10 @@ * inheritance: The caller's window structure may include extensions that * are not visible to NX. * - * NOTE: wnd must have been allocated using malloc() (or related allocators) + * NOTE: wnd must have been allocated using kmalloc() (or related allocators) * Once provided to nxfe_constructwindow() that memory is owned and managed * by NX. On certain error conditions or when the window is closed, NX will - * free() the window. + * free the window. * * Input Parameters: * handle - The handle returned by nx_connect @@ -113,7 +115,7 @@ int nxfe_constructwindow(NXHANDLE handle, FAR struct nxbe_window_s *wnd, if (!fe || !cb) { - free(wnd); + kfree(wnd); errno = EINVAL; return ERROR; } |