summaryrefslogtreecommitdiff
path: root/ndb/src/ndbapi/DictCache.cpp
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/DictCache.cpp
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/DictCache.cpp')
-rw-r--r--ndb/src/ndbapi/DictCache.cpp6
1 files changed, 4 insertions, 2 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;
}