tidwall / neco

Concurrency library for C (coroutines)
MIT License
1.1k stars 79 forks source link

In example 4, "arg2" undeclared in the neco_main #8

Closed RiverOnVenus closed 4 months ago

RiverOnVenus commented 4 months ago

Hello, I'm trying each of the examples and found a small mistake in example 4.

    int *arg1 = malloc(sizeof(int));
    *arg1 = 1;

    neco_start(coroutine, 5, &arg0, arg1, &(int){2}, NULL, "hello world");
    free(arg2);

free(arg2) should be free(arg1).

Regards

tidwall commented 4 months ago

Fixed. Thanks for reporting!