[v1,1/1] linux-gen: ishm: don't initialize anonymous mappings

Message ID 1536566407-6224-2-git-send-email-odpbot@yandex.ru
State New
Headers show
Series
  • linux-gen: ishm: don't initialize anonymous mappings
Related show

Commit Message

Github ODP bot Sept. 10, 2018, 8 a.m.
From: Josep Puigdemont <josep.puigdemont@linaro.org>


Anonymous mappings are automatically initalized to zero.
>From the mmap manual: "MAP_ANONYMOUS: The mapping is not backed by any

file; its contents are initialized to zero."

Signed-off-by: Josep Puigdemont <josep.puigdemont@linaro.org>

---
/** Email created from pull request 695 (joseppc:fix/no-init-mmap-anonymous)
 ** https://github.com/Linaro/odp/pull/695
 ** Patch: https://github.com/Linaro/odp/pull/695.patch
 ** Base sha: 6d48d7f7f684b8aa87f7eb4f922d45be345ed771
 ** Merge commit sha: 2287a4ca0a06b738b59a11115b1421d0a429df26
 **/
 platform/linux-generic/odp_ishm.c | 2 --
 1 file changed, 2 deletions(-)

Patch

diff --git a/platform/linux-generic/odp_ishm.c b/platform/linux-generic/odp_ishm.c
index 59d1fe534..07ce4d534 100644
--- a/platform/linux-generic/odp_ishm.c
+++ b/platform/linux-generic/odp_ishm.c
@@ -1508,7 +1508,6 @@  int _odp_ishm_init_global(const odp_init_t *init)
 		goto init_glob_err1;
 	}
 	ishm_tbl = addr;
-	memset(ishm_tbl, 0, sizeof(ishm_table_t));
 	ishm_tbl->dev_seq = 0;
 	ishm_tbl->odpthread_cnt = 0;
 	odp_spinlock_init(&ishm_tbl->lock);
@@ -1521,7 +1520,6 @@  int _odp_ishm_init_global(const odp_init_t *init)
 		goto init_glob_err2;
 	}
 	ishm_ftbl = addr;
-	memset(ishm_ftbl, 0, sizeof(ishm_ftable_t));
 
 	/*
 	 *reserve the address space for _ODP_ISHM_SINGLE_VA reserved blocks,