Sync to the latest version.

Can be broken or partially implemented.
This commit is contained in:
2024-04-23 23:45:43 +03:00
parent ec499b6cfc
commit 692b5b4297
26 changed files with 785 additions and 60 deletions

16
main.c
View File

@@ -4,18 +4,6 @@
#include <stdio.h>
#include <stdint.h>
#define BH_INT_TO_PTR(x) \
((void *)((long)(x)))
#define BH_UINT_TO_PTR(x) \
((void *)((unsigned long)(x)))
#define BH_PTR_TO_INT(x) \
((long)(x))
#define BH_PTR_TO_UINT(x) \
((unsigned long)(x))
size_t ptr_hash(const void *item)
{
return BH_PTR_TO_INT(item);
@@ -59,7 +47,7 @@ void factor_task(void *arg)
{
printf("Task start\n");
fflush(stdout);
printf("Factor: %d\n", factor(48));
printf("Factor: %d\n", factor(42));
fflush(stdout);
}
@@ -119,7 +107,7 @@ int main()
iter = bh_queue_iter_next(queue, NULL);
while (iter)
{
printf("%d\n", (int)bh_queue_iter_value(iter));
printf("%d\n", BH_PTR_TO_INT(bh_queue_iter_value(iter)));
iter = bh_queue_iter_next(queue, iter);
}