diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2013-12-30 12:42:18 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2013-12-30 12:42:18 -0600 |
commit | fd95f9ae75acb674be870e3a92c05816bcbbd819 (patch) | |
tree | d34df38748ca5e93ba645eae411983c56ea5d964 /nuttx/graphics/nxsu | |
parent | 8ca22c23fa3fa96cf661888f6b8a104d4c1cbd1b (diff) | |
download | nuttx-fd95f9ae75acb674be870e3a92c05816bcbbd819.tar.gz nuttx-fd95f9ae75acb674be870e3a92c05816bcbbd819.tar.bz2 nuttx-fd95f9ae75acb674be870e3a92c05816bcbbd819.zip |
NX: Use a consistent allocator in all configurations
Diffstat (limited to 'nuttx/graphics/nxsu')
-rw-r--r-- | nuttx/graphics/nxsu/nx_close.c | 4 | ||||
-rw-r--r-- | nuttx/graphics/nxsu/nx_constructwindow.c | 2 | ||||
-rw-r--r-- | nuttx/graphics/nxsu/nx_open.c | 6 | ||||
-rw-r--r-- | nuttx/graphics/nxsu/nx_openwindow.c | 6 |
4 files changed, 12 insertions, 6 deletions
diff --git a/nuttx/graphics/nxsu/nx_close.c b/nuttx/graphics/nxsu/nx_close.c index c1b9d1537..848513b5c 100644 --- a/nuttx/graphics/nxsu/nx_close.c +++ b/nuttx/graphics/nxsu/nx_close.c @@ -88,6 +88,8 @@ void nx_close(NXHANDLE handle) { - kfree(handle); + /* For consistency, we use the user-space allocate (if available) */ + + umm_free(handle); } diff --git a/nuttx/graphics/nxsu/nx_constructwindow.c b/nuttx/graphics/nxsu/nx_constructwindow.c index 6a0595181..1be780a2a 100644 --- a/nuttx/graphics/nxsu/nx_constructwindow.c +++ b/nuttx/graphics/nxsu/nx_constructwindow.c @@ -116,7 +116,7 @@ int nx_constructwindow(NXHANDLE handle, NXWINDOW wnd, if (!fe || !cb) { - kfree(wnd); + umm_free(wnd); errno = EINVAL; return ERROR; } diff --git a/nuttx/graphics/nxsu/nx_open.c b/nuttx/graphics/nxsu/nx_open.c index d8efcee41..4866f15ce 100644 --- a/nuttx/graphics/nxsu/nx_open.c +++ b/nuttx/graphics/nxsu/nx_open.c @@ -195,9 +195,11 @@ NXHANDLE nx_open(FAR NX_DRIVERTYPE *dev) } #endif - /* Allocate the NX state structure */ + /* Allocate the NX state structure. The user-space allocator is used + * (if available) for compatibility with the multi-user implementation. + */ - fe = (FAR struct nxfe_state_s *)kzalloc(sizeof(struct nxfe_state_s)); + fe = (FAR struct nxfe_state_s *)umm_zalloc(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 b1e632937..d085ad03e 100644 --- a/nuttx/graphics/nxsu/nx_openwindow.c +++ b/nuttx/graphics/nxsu/nx_openwindow.c @@ -103,9 +103,11 @@ NXWINDOW nx_openwindow(NXHANDLE handle, FAR const struct nx_callback_s *cb, } #endif - /* Pre-allocate the window structure */ + /* Pre-allocate the window structure. The user-space allocator is used (if + * available) for compatibility with the multi-user implementation. + */ - wnd = (FAR struct nxbe_window_s *)kzalloc(sizeof(struct nxbe_window_s)); + wnd = (FAR struct nxbe_window_s *)umm_zalloc(sizeof(struct nxbe_window_s)); if (!wnd) { errno = ENOMEM; |