RFR 8056084: Refactor Hashtable to allow implementations without rehashing support
Mikael Gerdin
mikael.gerdin at oracle.com
Thu Aug 28 06:03:09 UTC 2014
Hi Gerard,
On 08/27/2014 06:24 PM, Gerard Ziemski wrote:
> hi Mikael,
>
> I like the changes, even though I will have to merge my code with this
> change later ;-)
Great!
>
> The only thing that I don't understand, however, is the removed"#if
> defined(SOLARIS)" clause at the bottom of hashtable.cpp
That is indeed a bit strange. I was having a bit of template trouble
when getting this to compile across all platforms, I think I misread the
code as defined(SOLARIS) && defined(CHECK_UNHANDLED_OOPS) and removed
the Solaris part. I'll revert the #ifdef change.
>
> I am not a Reviewer (capital R), but please consider it reviewed
> (lowercase r)
Thanks
/Mikael
>
>
> cheers
>
> On 8/26/2014 10:26 AM, Mikael Gerdin wrote:
>> Hi all,
>>
>> For JDK-8048268 I need to do some refactoring of the Hashtable class
>> template.
>>
>> >From the bug description:
>> In order to simplify usage of the Hashtable<T, F> class the code to
>> perform
>> rehashing of the SymbolTable and StringTable should be factored out to an
>> intermediate class common to those two tables.
>> Also factor out HashtableEntry freelist allocation to allow
>> implementors an
>> easier route for providing their own memory management.
>>
>> Introducing the new intermediary superclass requires some calls to
>> superclass
>> functions to be qualified using the "this->" syntax due to the C++
>> template
>> name lookup rules.
>>
>> a comment about hashtable.cpp RehashableHashtable::dump_table:
>>
>> - int bucket_bytes = (int)num_buckets * sizeof(bucket(0));
>> + int bucket_bytes = (int)num_buckets * sizeof(HashtableBucket<F>);
>>
>> I decided to change the sizeof to count the size of the hashtable
>> bucket class
>> instead of the HashtableEntry* returned by bucket(0), even though they
>> may be
>> of the same size currently.
>>
>> Note that the webrev url refers to another bug.
>> Webrev:
>> http://cr.openjdk.java.net/~mgerdin/8048268/hashtable-refactor/webrev/
>> Buglink: https://bugs.openjdk.java.net/browse/JDK-8056084
>>
>> Testing: JPRT.
>>
>>
>>
>
More information about the hotspot-dev
mailing list