Skip to content

Commit

Permalink
improving map unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Kavaliou committed Aug 19, 2016
1 parent 079b027 commit 3ce08e1
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/main/cpp/thread_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,17 @@ struct ThreadBucket {
jvmtiEnv *tiEnv;
};

class AbstractMapProvider {
public:
virtual void put(void *key, void *value) = 0;
virtual void *get(void *key) = 0;
virtual void *remove(void *key) = 0;
virtual ~AbstractMapProvider() {}
};

#ifdef CONCURRENT_MAP_TBB

class TbbMapProvider {
class TbbMapProvider : public AbstractMapProvider {
private:
typedef tbb::concurrent_hash_map<void*, void*> HashMap;
HashMap map;
Expand Down Expand Up @@ -108,7 +115,7 @@ struct PointerHasher {

/* Hasher assumed to be collision free. */
template <typename Hasher>
class LockFreeMapProvider {
class LockFreeMapProvider : public AbstractMapProvider {
private:
LockFreeMapEntry *array;
int allocatedSize;
Expand Down

0 comments on commit 3ce08e1

Please sign in to comment.