Re: in which we present an ugly hack to make sys/queue.h CIRCLEQ work

2013-11-20 Thread David Holland
On Thu, Nov 21, 2013 at 01:16:44AM +0100, Rhialto wrote: > Ever since I grokked the elegance of Lists in AmigaOS, I've always > wondered why other list implementations do it differently. One reason is that with Amiga lists is that the list node structure needs to be at the beginning of the objec

Re: in which we present an ugly hack to make sys/queue.h CIRCLEQ work

2013-11-20 Thread David Holland
On Wed, Nov 20, 2013 at 07:01:15PM -0500, Ken Hornstein wrote: > #define TAILQ_PREV(elm, headname, field)\ > (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last)) There's another wrinkle, however, which is that this code (TAILQ_PREV) also violates th

Re: in which we present an ugly hack to make sys/queue.h CIRCLEQ work

2013-11-20 Thread Ken Hornstein
>I think it is actually 2 extra pointer deferences, You're right, my apologies. >but the important bit >is that one of the pointers is fetched from memory you might not need to >read from at all with a CIRCLEQ. On modern processors one cache miss is >worth a whole big pile of extra instructions,

Re: in which we present an ugly hack to make sys/queue.h CIRCLEQ work

2013-11-20 Thread Dennis Ferguson
On 20 Nov, 2013, at 16:01 , Ken Hornstein wrote: >> This functionally works, but the TAILQ data structure is not the same as >> the CIRCLEQ data structure (i.e. no ABI compatibility, if that matters; >> I'm not quite sure why it does) and unnecessarily penalizes applications >> which need to trav

Re: in which we present an ugly hack to make sys/queue.h CIRCLEQ work

2013-11-20 Thread Rhialto
On Wed 20 Nov 2013 at 15:32:20 -0800, Dennis Ferguson wrote: > If one were starting this from scratch [...] Ever since I grokked the elegance of Lists in AmigaOS, I've always wondered why other list implementations do it differently. A list is double linked, and it has dummy first and last nodes

Re: in which we present an ugly hack to make sys/queue.h CIRCLEQ work

2013-11-20 Thread Ken Hornstein
>This functionally works, but the TAILQ data structure is not the same as >the CIRCLEQ data structure (i.e. no ABI compatibility, if that matters; >I'm not quite sure why it does) and unnecessarily penalizes applications >which need to traverse the list in the tail->head direction. I know the data

Re: in which we present an ugly hack to make sys/queue.h CIRCLEQ work

2013-11-20 Thread Dennis Ferguson
On 20 Nov, 2013, at 12:32 , Zhihao Yuan wrote: > On Wed, Nov 20, 2013 at 12:07 PM, Ken Hornstein wrote: >> I see that at least on MacOS X, sys/queue.h contains the following note: >> >> * Note that circle queues are deprecated, because, as the removal log >> * in FreeBSD states, "CIRCLEQs are a

Re: in which we present an ugly hack to make sys/queue.h CIRCLEQ work

2013-11-20 Thread Zhihao Yuan
On Wed, Nov 20, 2013 at 12:07 PM, Ken Hornstein wrote: > I see that at least on MacOS X, sys/queue.h contains the following note: > > * Note that circle queues are deprecated, because, as the removal log > * in FreeBSD states, "CIRCLEQs are a disgrace to everything Knuth taught > * us in Volume

Re: in which we present an ugly hack to make sys/queue.h CIRCLEQ work

2013-11-20 Thread Dennis Ferguson
On 20 Nov, 2013, at 01:54 , matthew green wrote: > unfortunately, changing these macros to be strictly C requires changing > the ABI of them, and while we are going to consider such a change, in > the interest of getting things working we present the following hack. > it was inspired by David Hol

Re: in which we present an ugly hack to make sys/queue.h CIRCLEQ work

2013-11-20 Thread Daode
matthew green wrote: |while preparing to update to GCC 4.8 i discovered that our sys/queue.h |CIRCLEQ macros violate C aliasing rules, ultimately leading to the |compiler eliding comparisons it declared as always false. I am far away from penetrating these C sequence point and aliasing semanti

Re: A Library for Converting Data to and from C Structs for Lua

2013-11-20 Thread Marc Balmer
Am 18.11.13 00:46, schrieb John Nemeth: > On Nov 17, 11:02pm, Marc Balmer wrote: > } Am 17.11.13 20:40, schrieb Lourival Vieira Neto: > } > On Sun, Nov 17, 2013 at 4:39 PM, David Holland > wrote: > } >> On Sun, Nov 17, 2013 at 01:32:03PM +0100, Hubert Feyrer wrote: > } >> > >I plan to import it

Re: A Library for Converting Data to and from C Structs for Lua

2013-11-20 Thread Justin Cormack
On 20 Nov 2013 08:38, "Marc Balmer" wrote: > > Now we need a name that covers both uses cases. It could be "memory" > > because it deals with memory, or just "data", which I favour. > > > > Opinions on the name? > > Since no one replied, it will go by the name 'data' and be available for > "both"

Re: in which we present an ugly hack to make sys/queue.h CIRCLEQ work

2013-11-20 Thread Matthew Orgass
On 2013-11-20 m...@eterna.com.au wrote: i'm going to commit this soon, but if anyone has more useful hacks or real fixes, please let me/these lists know and we'll consider them. + * If we ever choose to change the ABI of the CIRCLEQ macros, we could fix + * this by changing the If changin

Re: in which we present an ugly hack to make sys/queue.h CIRCLEQ work

2013-11-20 Thread Ken Hornstein
>while preparing to update to GCC 4.8 i discovered that our sys/queue.h >CIRCLEQ macros violate C aliasing rules, ultimately leading to the >compiler eliding comparisons it declared as always false. I see that at least on MacOS X, sys/queue.h contains the following note: * Note that circle queue

Re: Replace VI_INACT*

2013-11-20 Thread David Holland
On Tue, Nov 19, 2013 at 11:57:14AM +0100, J. Hannken-Illjes wrote: > The attached diff will: > > Replace VI_INACTNOW and VI_INACTREDO with a new flag VI_CHANGING that gets > set while a vnode changes state from active to inactive or from active > or inactive to clean and protects "vclean(); v

Re: A Library for Converting Data to and from C Structs for Lua

2013-11-20 Thread Lourival Vieira Neto
On Wed, Nov 20, 2013 at 10:38 AM, Marc Balmer wrote: > Am 20.11.13 13:33, schrieb Lourival Vieira Neto: >> On Wed, Nov 20, 2013 at 6:36 AM, Marc Balmer wrote: >>> Am 18.11.13 09:07, schrieb Marc Balmer: Am 17.11.13 13:05, schrieb Marc Balmer: > I came accross a small library for converti

Re: A Library for Converting Data to and from C Structs for Lua

2013-11-20 Thread Marc Balmer
Am 20.11.13 13:33, schrieb Lourival Vieira Neto: > On Wed, Nov 20, 2013 at 6:36 AM, Marc Balmer wrote: >> Am 18.11.13 09:07, schrieb Marc Balmer: >>> Am 17.11.13 13:05, schrieb Marc Balmer: I came accross a small library for converting data to an from C structs for Lua, written by Robert

Re: A Library for Converting Data to and from C Structs for Lua

2013-11-20 Thread Lourival Vieira Neto
On Wed, Nov 20, 2013 at 7:31 AM, Marc Balmer wrote: > Am 20.11.13 10:26, schrieb Justin Cormack: >> >> On 20 Nov 2013 08:38, "Marc Balmer" mailto:m...@msys.ch>> >> wrote: >>> > Now we need a name that covers both uses cases. It could be "memory" >>> > because it deals with memory, or just "data",

Re: A Library for Converting Data to and from C Structs for Lua

2013-11-20 Thread Lourival Vieira Neto
On Wed, Nov 20, 2013 at 6:36 AM, Marc Balmer wrote: > Am 18.11.13 09:07, schrieb Marc Balmer: >> Am 17.11.13 13:05, schrieb Marc Balmer: >>> I came accross a small library for converting data to an from C structs >>> for Lua, written by Roberto Ierusalimschy: >>> >>> http://www.inf.puc-rio.br/~rob

Re: vmem boundary tag manged with pool

2013-11-20 Thread Lars Heidieker
On 11/19/2013 11:02 PM, matthew green wrote: >> I would like to change the way vmem(9) allocates boundary tags towards >> using a pool(9) for that. >> >> This de-duplicates code and makes it possible to release memory pages >> used for boundary tags. >> >> early patch any comments? > > i fear addi

in which we present an ugly hack to make sys/queue.h CIRCLEQ work

2013-11-20 Thread matthew green
hi folks. while preparing to update to GCC 4.8 i discovered that our sys/queue.h CIRCLEQ macros violate C aliasing rules, ultimately leading to the compiler eliding comparisons it declared as always false. unfortunately, changing these macros to be strictly C requires changing the ABI of them,

Re: A Library for Converting Data to and from C Structs for Lua

2013-11-20 Thread Marc Balmer
Am 20.11.13 10:26, schrieb Justin Cormack: > > On 20 Nov 2013 08:38, "Marc Balmer" mailto:m...@msys.ch>> > wrote: >> > Now we need a name that covers both uses cases. It could be "memory" >> > because it deals with memory, or just "data", which I favour. >> > >> > Opinions on the name? >> >> Sinc

Re: A Library for Converting Data to and from C Structs for Lua

2013-11-20 Thread Marc Balmer
Am 18.11.13 09:07, schrieb Marc Balmer: > Am 17.11.13 13:05, schrieb Marc Balmer: >> I came accross a small library for converting data to an from C structs >> for Lua, written by Roberto Ierusalimschy: >> >> http://www.inf.puc-rio.br/~roberto/struct/ >> >> I plan to import it and to make it availa