You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mnemonic.apache.org by ga...@apache.org on 2016/09/27 07:20:17 UTC

incubator-mnemonic git commit: MNEMONIC-127: Misused id as key in native pmalloc memory service

Repository: incubator-mnemonic
Updated Branches:
  refs/heads/master 6b2a4d023 -> c48b25c8d


MNEMONIC-127: Misused id as key in native pmalloc memory service


Project: http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/commit/c48b25c8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/tree/c48b25c8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/diff/c48b25c8

Branch: refs/heads/master
Commit: c48b25c8dc0b50e7f31e84ac46e7d7cc9e48ab8d
Parents: 6b2a4d0
Author: Wang, Gang(Gary) <ga...@intel.com>
Authored: Tue Sep 27 00:19:48 2016 -0700
Committer: Wang, Gang(Gary) <ga...@intel.com>
Committed: Tue Sep 27 00:19:48 2016 -0700

----------------------------------------------------------------------
 ..._mnemonic_service_memoryservice_internal_PMallocServiceImpl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/c48b25c8/mnemonic-memory-services/mnemonic-pmalloc-service/src/main/native/org_apache_mnemonic_service_memoryservice_internal_PMallocServiceImpl.c
----------------------------------------------------------------------
diff --git a/mnemonic-memory-services/mnemonic-pmalloc-service/src/main/native/org_apache_mnemonic_service_memoryservice_internal_PMallocServiceImpl.c b/mnemonic-memory-services/mnemonic-pmalloc-service/src/main/native/org_apache_mnemonic_service_memoryservice_internal_PMallocServiceImpl.c
index aef6da9..2a8d4cc 100644
--- a/mnemonic-memory-services/mnemonic-pmalloc-service/src/main/native/org_apache_mnemonic_service_memoryservice_internal_PMallocServiceImpl.c
+++ b/mnemonic-memory-services/mnemonic-pmalloc-service/src/main/native/org_apache_mnemonic_service_memoryservice_internal_PMallocServiceImpl.c
@@ -298,7 +298,7 @@ void JNICALL Java_org_apache_mnemonic_service_memoryservice_internal_PMallocServ
   pthread_rwlock_rdlock(&g_pmp_rwlock);
   pthread_mutex_lock(g_pmalloc_mutex_ptr + id);
   void *md = *(g_pmp_ptr + id);
-  if (id < PMALLOC_KEYS && id >= 0) {
+  if (key < PMALLOC_KEYS && key >= 0) {
     pmalloc_setkey(md, key, (void*)value);
   }
   pthread_mutex_unlock(g_pmalloc_mutex_ptr + id);
@@ -311,7 +311,7 @@ jlong JNICALL Java_org_apache_mnemonic_service_memoryservice_internal_PMallocSer
   pthread_rwlock_rdlock(&g_pmp_rwlock);
   pthread_mutex_lock(g_pmalloc_mutex_ptr + id);
   void *md = *(g_pmp_ptr + id);
-  jlong ret = (id < PMALLOC_KEYS && id >= 0) ? (long) pmalloc_getkey(md, key) : 0;
+  jlong ret = (key < PMALLOC_KEYS && key >= 0) ? (long) pmalloc_getkey(md, key) : 0;
   pthread_mutex_unlock(g_pmalloc_mutex_ptr + id);
   pthread_rwlock_unlock(&g_pmp_rwlock);
   return ret;