summaryrefslogtreecommitdiff
path: root/src/lib/ecore_wayland/ecore_wl_window.c
diff options
context:
space:
mode:
authorBryce Harrington <bryce@osg.samsung.com>2015-03-17 20:30:32 -0400
committerChris Michael <cp.michael@samsung.com>2015-03-17 20:30:32 -0400
commita2e301db71b93fb5981c6aa3f7988fc220ec5d0b (patch)
tree5489bccfdf3c562065582d73677e18d93255bdf0 /src/lib/ecore_wayland/ecore_wl_window.c
parentc0bc1be83e55de2b0ed0dc1ad24a8e43461cad5f (diff)
ecore-wayland: Use calloc rather than malloc+memset
Summary: In addition to being fewer lines of code, malloc + memset to 0 is slower than calloc. See http://stackoverflow.com/questions/2688466/why-mallocmemset-is-slower-than-calloc Signed-off-by: Bryce Harrington <bryce@osg.samsung.com> Reviewers: zmike, cedric, devilhorns Reviewed By: devilhorns Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2182
Diffstat (limited to 'src/lib/ecore_wayland/ecore_wl_window.c')
-rw-r--r--src/lib/ecore_wayland/ecore_wl_window.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/lib/ecore_wayland/ecore_wl_window.c b/src/lib/ecore_wayland/ecore_wl_window.c
index 05f38321e4..8f2f192ebe 100644
--- a/src/lib/ecore_wayland/ecore_wl_window.c
+++ b/src/lib/ecore_wayland/ecore_wl_window.c
@@ -74,14 +74,12 @@ ecore_wl_window_new(Ecore_Wl_Window *parent, int x, int y, int w, int h, int buf
74 74
75 LOGFN(__FILE__, __LINE__, __FUNCTION__); 75 LOGFN(__FILE__, __LINE__, __FUNCTION__);
76 76
77 if (!(win = malloc(sizeof(Ecore_Wl_Window)))) 77 if (!(win = calloc(1, sizeof(Ecore_Wl_Window))))
78 { 78 {
79 ERR("Failed to allocate an Ecore Wayland Window"); 79 ERR("Failed to allocate an Ecore Wayland Window");
80 return NULL; 80 return NULL;
81 } 81 }
82 82
83 memset(win, 0, sizeof(Ecore_Wl_Window));
84
85 win->display = _ecore_wl_disp; 83 win->display = _ecore_wl_disp;
86 win->parent = parent; 84 win->parent = parent;
87 win->allocation.x = x; 85 win->allocation.x = x;