-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from 0152la/tommyds_hashmap
Hashtable backend
- Loading branch information
Showing
14 changed files
with
308 additions
and
184 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,6 @@ | |
[submodule "third-party/tomlc99"] | ||
path = third-party/tomlc99 | ||
url = https://github.com/cktan/tomlc99 | ||
[submodule "third-party/tommyds"] | ||
path = third-party/tommyds | ||
url = [email protected]:amadvance/tommyds.git |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#ifndef _CHERICOMP_SYMBOLS_COMP_H | ||
#define _CHERICOMP_SYMBOLS_COMP_H | ||
|
||
#include "symbols.h" | ||
#include "symbols_lib.h" | ||
|
||
typedef tommy_hashtable comp_symbol_list; | ||
typedef struct CompSymbol comp_symbol; | ||
|
||
/* Struct representing a wrapper around a LibDependencySymbol, in order to | ||
* facilitate compartment-level searching | ||
*/ | ||
struct CompSymbol | ||
{ | ||
struct LibDependencySymbol *sym_ref; | ||
size_t sym_lib_idx; | ||
tommy_node node; | ||
}; | ||
|
||
comp_symbol_list * | ||
comp_syms_init(); | ||
void | ||
comp_syms_clean(comp_symbol_list *); | ||
void | ||
comp_syms_clean_deep(comp_symbol_list *); | ||
void | ||
comp_syms_insert(comp_symbol *, comp_symbol_list *); | ||
comp_symbol * | ||
comp_syms_search(const char *, comp_symbol_list *); | ||
comp_symbol ** | ||
comp_syms_find_all(const char *, comp_symbol_list *); | ||
|
||
void update_comp_syms(comp_symbol_list*, lib_symbol_list *, const size_t); | ||
|
||
#endif // _CHERICOMP_SYMBOLS_COMP_H |
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,36 @@ | ||
#ifndef _CHERICOMP_SYMBOLS_LIB_H | ||
#define _CHERICOMP_SYMBOLS_LIB_H | ||
|
||
#include "symbols.h" | ||
|
||
typedef tommy_hashtable lib_symbol_list; | ||
typedef struct LibDependencySymbol lib_symbol; | ||
|
||
/* Struct representing a symbol entry of a dependency library | ||
*/ | ||
struct LibDependencySymbol | ||
{ | ||
char *sym_name; | ||
void *sym_offset; | ||
unsigned short sym_type; | ||
unsigned short sym_bind; | ||
uint16_t sym_shndx; | ||
tommy_node node; | ||
}; | ||
|
||
lib_symbol_list * | ||
lib_syms_init(); | ||
void | ||
lib_syms_clean(lib_symbol_list *); | ||
void | ||
lib_syms_clean_deep(lib_symbol_list *); | ||
void | ||
lib_syms_insert(lib_symbol *, lib_symbol_list *); | ||
lib_symbol * | ||
lib_syms_search(const char *, lib_symbol_list *); | ||
lib_symbol ** | ||
lib_syms_find_all(const char *, lib_symbol_list *); | ||
void | ||
lib_syms_print(lib_symbol_list*); | ||
|
||
#endif // _CHERICOMP_SYMBOLS_LIB_H |
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.