wangzhengquan
2020-08-06 4d5adf4ac44c864e67e8019bb97d89199bb0b4b7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "usg_common.h"
#include "usg_typedef.h"
#include "hashtable.h"
#include "shm_mm.h"
 
int main() {
    shm_init(512);
    hashtable_t hashtable;
 
    hashtable_init(&hashtable);
    for(int i = 0; i < 10; i++) {
        hashtable_put(&hashtable, i, (void *)(i));
    }
 
    hashtable_foreach(&hashtable, [&](int key, void * value){
        printf("%d, %p\n", key, value);
    });
    shm_destroy();
}