remove copy allocator, since it is not needed

This commit is contained in:
Julian Daube 2017-10-25 20:28:01 +02:00
parent 5970eae220
commit ee37ac4da9
2 changed files with 9 additions and 3 deletions

View File

@ -22,8 +22,6 @@ typedef struct entry * hashtable_iterator_t;
// data deallocator // data deallocator
typedef void(*hashtable_dealloc)(void*); typedef void(*hashtable_dealloc)(void*);
// data copy and allocator
typedef void(*hashtable_alloc)(void*);
extern int key_compare(entry_key_t one, entry_key_t two); extern int key_compare(entry_key_t one, entry_key_t two);
extern entry_hash_t key_hash(entry_key_t key); extern entry_hash_t key_hash(entry_key_t key);
@ -38,10 +36,11 @@ struct hashtable {
struct entry * data; struct entry * data;
size_t len, count; size_t len, count;
hashtable_alloc alloc_data;
hashtable_dealloc dealloc_data; hashtable_dealloc dealloc_data;
}; };
extern void hashtable_init(struct hashtable * table);
extern hashtable_iterator_t hashtable_end(struct hashtable * table); extern hashtable_iterator_t hashtable_end(struct hashtable * table);
/** /**

View File

@ -42,6 +42,13 @@ void testadd() {
pass(); pass();
} }
volatile int number_copied = 0;
void* test_copy(void * data) {
number_copied++;
return data;
}
void testget() { void testget() {
init("get"); init("get");