Nick Ulle

Results 17 comments of Nick Ulle

The 4 whitespaces are necessary for pandoc's four-space rule.

Yes, I really do want to allocate the memory for them. Unless I'm misunderstanding, the correct sizes would normally be filled in during linking. The context for this is allocating...

Clang doesn't even declare the structs, it treats them as int64s. But I'm not sure how it arrived at int64 as the first element of the pthreads structs. ``` llvm...

``` c #include #include #include #define N_THREADS 5 void *PrintHello(void *thread_id) { long tid = (long) thread_id; printf("Hello World! It's thread %li!\n", tid); pthread_exit(NULL); } int main(int argc, char **argv)...

No, I don't either. I just meant that there's nothing wrong with allocating a forward-declared struct on the stack.

For now, I think I can work around this using i64 instead of opaque structs.

Clang has no problem with this: ``` c #include #include #include #define N_THREADS 1 void *PrintHello(void *thread_id) { long tid = (long) thread_id; printf("Hello World! It's thread %li!\n", tid); pthread_exit(NULL);...

The line ``` c pthread_t thread; ``` corresponds directly to the IR ``` llvm %thread = alloca i64, align 8 ``` Whether it's an array or not, memory is being...

Unless you mean that pthread_t is itself just holding a pointer (as its element)? But I still don't see how that gets out of the need to alloc an array...