Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
replace slow linked list with fast hash
- Loading branch information
1 parent
597d233
commit b329817
Showing
10 changed files
with
192 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
|
||
// Copyright (c) 2011-2011 by Digital Mars | ||
// All Rights Reserved | ||
// written by Walter Bright | ||
// http://www.digitalmars.com | ||
// License for redistribution is by either the Artistic License | ||
// in artistic.txt, or the GNU General Public License in gpl.txt. | ||
// See the included readme.txt for details. | ||
|
||
|
||
#include <stdlib.h> | ||
|
||
#include "tinfo.h" | ||
|
||
|
||
// void* | ||
|
||
TypeInfo_Pvoid ti_pvoid; | ||
|
||
const char* TypeInfo_Pvoid::toString() | ||
{ | ||
return "void*"; | ||
} | ||
|
||
hash_t TypeInfo_Pvoid::getHash(void *p) | ||
{ void* s = *(void **)p; | ||
return (hash_t)s; | ||
} | ||
|
||
int TypeInfo_Pvoid::equals(void *p1, void *p2) | ||
{ | ||
void* s1 = *(void**)p1; | ||
void* s2 = *(void**)p2; | ||
|
||
return s1 == s2; | ||
} | ||
|
||
int TypeInfo_Pvoid::compare(void *p1, void *p2) | ||
{ | ||
void* s1 = *(void**)p1; | ||
void* s2 = *(void**)p2; | ||
|
||
return (s1 < s2) ? -1 : ((s1 == s2) ? 0 : 1); | ||
} | ||
|
||
size_t TypeInfo_Pvoid::tsize() | ||
{ | ||
return sizeof(void*); | ||
} | ||
|
||
void TypeInfo_Pvoid::swap(void *p1, void *p2) | ||
{ | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.