mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-24 04:25:06 +02:00
Working through compiling gc, added more TODO's
This commit is contained in:
parent
eb068a13cf
commit
894a1d3fcd
1 changed files with 14 additions and 9 deletions
|
@ -96,17 +96,13 @@ ck_array_commit(ck_array_t *array);
|
||||||
#define CK_ARRAY_FOREACH(a, i, b) \
|
#define CK_ARRAY_FOREACH(a, i, b) \
|
||||||
pthread_mutex_lock(&((a)->lock)); \
|
pthread_mutex_lock(&((a)->lock)); \
|
||||||
int tmpc = (a)->hs->nitems; \
|
int tmpc = (a)->hs->nitems; \
|
||||||
size_t *tmp = calloc(tmpc, sizeof(struct hashset_st)); \
|
void **tmp = alloca(sizeof(void *) * tmpc); \
|
||||||
for (unsigned int tmpi = 0, tmpii = 0; tmpi < tmpc; tmpi++) { \
|
hashset_to_array((a)->hs, tmp); \
|
||||||
if ((a)->hs->items != 0 && (a)->hs->items != 1) { \
|
|
||||||
tmp[tmpii] = (a)->hs->items[tmpi]; \
|
|
||||||
tmpii++; \
|
|
||||||
} \
|
|
||||||
} \
|
|
||||||
pthread_mutex_unlock(&((a)->lock)); \
|
pthread_mutex_unlock(&((a)->lock)); \
|
||||||
for (unsigned int _ck_i = 0, (*b) = (a)->hs->items[_ck_i]; \
|
if (tmpc > 0) { (*b) = tmp[0]; } \
|
||||||
|
for (unsigned int _ck_i = 0; \
|
||||||
_ck_i < tmpc; \
|
_ck_i < tmpc; \
|
||||||
_ck_i++, (*b) = (a)->hs->items[_ck_i])
|
_ck_i++, (*b) = tmp[_ck_i])
|
||||||
|
|
||||||
// CAS section
|
// CAS section
|
||||||
bool
|
bool
|
||||||
|
@ -118,4 +114,13 @@ ck_pr_cas_int(int *target, int old_value, int new_value);
|
||||||
bool
|
bool
|
||||||
ck_pr_cas_8(uint8_t *target, uint8_t old_value, uint8_t new_value);
|
ck_pr_cas_8(uint8_t *target, uint8_t old_value, uint8_t new_value);
|
||||||
|
|
||||||
|
|
||||||
|
TODO:
|
||||||
|
ck_pr_add_8
|
||||||
|
ck_pr_add_int
|
||||||
|
ck_pr_add_ptr
|
||||||
|
ck_pr_load_8
|
||||||
|
ck_pr_load_int
|
||||||
|
ck_pr_load_ptr
|
||||||
|
|
||||||
#endif /* CYCLONE_CK_POLYFILL_H */
|
#endif /* CYCLONE_CK_POLYFILL_H */
|
||||||
|
|
Loading…
Add table
Reference in a new issue