Skip to content

Commit

Permalink
Align inner types too
Browse files Browse the repository at this point in the history
  • Loading branch information
tidwall committed May 14, 2024
1 parent 052e4c5 commit 7d03e80
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions neco.c
Original file line number Diff line number Diff line change
Expand Up @@ -7077,6 +7077,7 @@ int neco_serve(const char *network, const char *address) {
////////////////////////////////////////////////////////////////////////////////

struct neco_mutex {
_Alignas(16) // needed for opaque type alias
int64_t rtid; // runtime id
bool locked; // mutex is locked (read or write)
int rlocked; // read lock counter
Expand Down Expand Up @@ -7336,9 +7337,10 @@ int neco_mutex_destroy(neco_mutex *mutex) {
}

struct neco_waitgroup {
int64_t rtid;
int count;
struct colist queue;
_Alignas(16) // needed for opaque type alias
int64_t rtid; // runtime id
int count; // current wait count
struct colist queue; // coroutine doubly linked list
};

static_assert(sizeof(neco_waitgroup) >= sizeof(struct neco_waitgroup), "");
Expand Down Expand Up @@ -7485,8 +7487,9 @@ int neco_waitgroup_destroy(neco_waitgroup *waitgroup) {
}

struct neco_cond {
int64_t rtid; // runtime id
struct colist queue; // coroutine doubly linked list
_Alignas(16) // needed for opaque type alias
int64_t rtid; // runtime id
struct colist queue; // coroutine doubly linked list
};

static_assert(sizeof(neco_cond) >= sizeof(struct neco_cond), "");
Expand Down

0 comments on commit 7d03e80

Please sign in to comment.