From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: Date: Mon, 20 Nov 2006 22:08:00 -0500 From: "Russ Cox" To: "Fans of the OS Plan 9 from Bell Labs" <9fans@cse.psu.edu> Subject: Re: [9fans] Creating a custom jmp_buf; libthread implementation question In-Reply-To: <7871fcf50611201903m3a8aaefdk10b544067ef8999c@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <64c8196ab25721b971e64c96b6f8e065@plan9.jp> <7871fcf50611131933h1b7ee706vc56be7b37cd6b58b@mail.gmail.com> <775b8d190611140139i4e28842dndd5bede4255b4b11@mail.gmail.com> <7871fcf50611201903m3a8aaefdk10b544067ef8999c@mail.gmail.com> Topicbox-Message-UUID: e4266a9c-ead1-11e9-9d60-3106f5b1d025 > tos = (ulong*)&t->stk[t->stksize&~7]; t->stksize&~7 is the bit-fiddly yet idiomatic way to round stksize down to a multiple of 8. Since t->stk is 8-aligned already, this makes sure that tos is 8-aligned. Russ