summaryrefslogtreecommitdiff
path: root/ndb/src/ndbapi
diff options
context:
space:
mode:
authorunknown <pekka@mysql.com>2004-12-09 15:18:31 +0100
committerunknown <pekka@mysql.com>2004-12-09 15:18:31 +0100
commit52a754edd3f1961998b098f1a907fb068040a8ea (patch)
tree3b7af2a47f3225b5ef4c7cd81b76e7e19d104e53 /ndb/src/ndbapi
parentd1ec91be3faf7787c9d3e5220c945ed13c7b8350 (diff)
downloadmariadb-git-52a754edd3f1961998b098f1a907fb068040a8ea.tar.gz
ndb: sunfire100c: fix aligment when 32-bit pointers and 64-bit ha_rows
ndb/src/ndbapi/DictCache.cpp: fix aligment when 32-bit pointers and 64-bit ha_rows ndb/src/ndbapi/DictCache.hpp: fix aligment when 32-bit pointers and 64-bit ha_rows
Diffstat (limited to 'ndb/src/ndbapi')
-rw-r--r--ndb/src/ndbapi/DictCache.cpp6
-rw-r--r--ndb/src/ndbapi/DictCache.hpp2
2 files changed, 5 insertions, 3 deletions
diff --git a/ndb/src/ndbapi/DictCache.cpp b/ndb/src/ndbapi/DictCache.cpp
index 12300ce216f..afdb37aa53f 100644
--- a/ndb/src/ndbapi/DictCache.cpp
+++ b/ndb/src/ndbapi/DictCache.cpp
@@ -24,10 +24,12 @@
Ndb_local_table_info *
Ndb_local_table_info::create(NdbTableImpl *table_impl, Uint32 sz)
{
- void *data= malloc(sizeof(NdbTableImpl)+sz-1);
+ if (sz % 8 != 0) // round to Uint64
+ sz += 8 - sz % 8;
+ void *data= malloc(sizeof(NdbTableImpl)+sz-8);
if (data == 0)
return 0;
- memset(data,0,sizeof(NdbTableImpl)+sz-1);
+ memset(data,0,sizeof(NdbTableImpl)+sz-8);
new (data) Ndb_local_table_info(table_impl);
return (Ndb_local_table_info *) data;
}
diff --git a/ndb/src/ndbapi/DictCache.hpp b/ndb/src/ndbapi/DictCache.hpp
index 0dc853306fa..a517acee56b 100644
--- a/ndb/src/ndbapi/DictCache.hpp
+++ b/ndb/src/ndbapi/DictCache.hpp
@@ -32,7 +32,7 @@ public:
static Ndb_local_table_info *create(NdbTableImpl *table_impl, Uint32 sz=0);
static void destroy(Ndb_local_table_info *);
NdbTableImpl *m_table_impl;
- char m_local_data[1];
+ Uint64 m_local_data[1];
private:
Ndb_local_table_info(NdbTableImpl *table_impl);
~Ndb_local_table_info();