MCPcopy Create free account
hub / github.com/VirtualGL/virtualgl / add

Method add

server/Hash.h:59–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57 }
58
59 int add(HashKeyType1 key1, HashKeyType2 key2, HashValueType value,
60 bool useRef = false)
61 {
62 HashEntry *entry = NULL;
63
64 if(!key1) THROW("Invalid argument");
65 util::CriticalSection::SafeLock l(mutex);
66
67 if((entry = findEntry(key1, key2)) != NULL)
68 {
69 if(value) entry->value = value;
70 if(useRef) entry->refCount++;
71 return 0;
72 }
73 entry = new HashEntry;
74 memset(entry, 0, sizeof(HashEntry));
75 entry->prev = end; if(end) end->next = entry;
76 if(!start) start = entry;
77 end = entry;
78 end->key1 = key1; end->key2 = key2; end->value = value;
79 if(useRef) end->refCount = 1;
80 count++;
81 return 1;
82 }
83
84 HashValueType find(HashKeyType1 key1, HashKeyType2 key2)
85 {

Callers 15

createContextFunction · 0.45
createPbufferFunction · 0.45
xcb_create_windowFunction · 0.45
xcb_create_window_auxFunction · 0.45
XSetEventQueueOwnerFunction · 0.45
glXChooseVisualFunction · 0.45
glXCreateContextFunction · 0.45
glXCreateNewContextFunction · 0.45
glXCreatePbufferFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected