Commit 52a754ed authored by unknown's avatar unknown

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
parent d1ec91be
...@@ -24,10 +24,12 @@ ...@@ -24,10 +24,12 @@
Ndb_local_table_info * Ndb_local_table_info *
Ndb_local_table_info::create(NdbTableImpl *table_impl, Uint32 sz) 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) if (data == 0)
return 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); new (data) Ndb_local_table_info(table_impl);
return (Ndb_local_table_info *) data; return (Ndb_local_table_info *) data;
} }
......
...@@ -32,7 +32,7 @@ public: ...@@ -32,7 +32,7 @@ public:
static Ndb_local_table_info *create(NdbTableImpl *table_impl, Uint32 sz=0); static Ndb_local_table_info *create(NdbTableImpl *table_impl, Uint32 sz=0);
static void destroy(Ndb_local_table_info *); static void destroy(Ndb_local_table_info *);
NdbTableImpl *m_table_impl; NdbTableImpl *m_table_impl;
char m_local_data[1]; Uint64 m_local_data[1];
private: private:
Ndb_local_table_info(NdbTableImpl *table_impl); Ndb_local_table_info(NdbTableImpl *table_impl);
~Ndb_local_table_info(); ~Ndb_local_table_info();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment