< prev index next >
src/share/vm/utilities/hashtable.cpp
Print this page
*** 203,222 ****
return bytes;
}
// Dump the hash table entries (into CDS archive)
template <MEMFLAGS F> void BasicHashtable<F>::copy_table(char* top, char* end) {
! assert(is_ptr_aligned(top, sizeof(intptr_t)), "bad alignment");
intptr_t *plen = (intptr_t*)(top);
top += sizeof(*plen);
int i;
for (i = 0; i < _table_size; ++i) {
for (BasicHashtableEntry<F>** p = _buckets[i].entry_addr();
*p != NULL;
p = (*p)->next_addr()) {
! *p = (BasicHashtableEntry<F>*)memcpy(top, *p, entry_size());
top += entry_size();
}
}
*plen = (char*)(top) - (char*)plen - sizeof(*plen);
assert(top == end, "count_bytes_for_table is wrong");
--- 203,222 ----
return bytes;
}
// Dump the hash table entries (into CDS archive)
template <MEMFLAGS F> void BasicHashtable<F>::copy_table(char* top, char* end) {
! assert(is_aligned(top, sizeof(intptr_t)), "bad alignment");
intptr_t *plen = (intptr_t*)(top);
top += sizeof(*plen);
int i;
for (i = 0; i < _table_size; ++i) {
for (BasicHashtableEntry<F>** p = _buckets[i].entry_addr();
*p != NULL;
p = (*p)->next_addr()) {
! *p = (BasicHashtableEntry<F>*)memcpy(top, (void*)*p, entry_size());
top += entry_size();
}
}
*plen = (char*)(top) - (char*)plen - sizeof(*plen);
assert(top == end, "count_bytes_for_table is wrong");
*** 292,302 ****
return bytes;
}
// Dump the buckets (into CDS archive)
template <MEMFLAGS F> void BasicHashtable<F>::copy_buckets(char* top, char* end) {
! assert(is_ptr_aligned(top, sizeof(intptr_t)), "bad alignment");
intptr_t len = _table_size * sizeof(HashtableBucket<F>);
*(intptr_t*)(top) = len;
top += sizeof(intptr_t);
*(intptr_t*)(top) = _number_of_entries;
--- 292,302 ----
return bytes;
}
// Dump the buckets (into CDS archive)
template <MEMFLAGS F> void BasicHashtable<F>::copy_buckets(char* top, char* end) {
! assert(is_aligned(top, sizeof(intptr_t)), "bad alignment");
intptr_t len = _table_size * sizeof(HashtableBucket<F>);
*(intptr_t*)(top) = len;
top += sizeof(intptr_t);
*(intptr_t*)(top) = _number_of_entries;
< prev index next >