last try on XorLinkList

This commit is contained in:
eason
2023-12-21 00:47:36 +08:00
parent 11bb78c63b
commit 02e0d1d86f
13 changed files with 149 additions and 1506 deletions

View File

@ -1,13 +1,13 @@
#define clock_start usize freq=0;\
u64 begin=rdtsc_64bits();
#define clock_end u64 end=rdtsc_64bits(); \
printf(" execute cycle(s) %llu, %zu operation(s) take place!\n",end-begin,freq);
#define clock_end u64 end=rdtsc_64bits();
// printf(" execute cycle(s) %llu, %zu operation(s) take place!\n",end-begin,freq);
#define record_start u64 r_begin=rdtsc_64bits();
#define record_end(x) output_csv(x,r_begin);
// #define record_start u64 r_begin=rdtsc_64bits();
// #define record_end(x) output_csv(x,r_begin);
// #define record_start ;
// #define record_end(x) ;
#define record_start ;
#define record_end(x) ;
unsigned long long int rdtsc_64bits();
void output_csv(char * filename,unsigned long long int old);

View File

@ -1,3 +1,4 @@
#include <stdbool.h>
#include "rust.h"
struct Node{
@ -8,6 +9,8 @@ struct Node{
struct Node* xor_new(void * val);
struct Node* xor_next(struct Node* previous,struct Node* current);
struct Node* xor_insert_front(struct Node* head,void* val);
struct Node* xor_insert_condition(struct Node* head,void* val,bool (*cmp)(void *,void *));
struct Node* xor_insert_mid(struct Node* previous,struct Node* current,void * val);
void debug_head(struct Node* head);
void * xor_remove(struct Node * previous,struct Node* current);
usize xor_count(struct Node* head);