Re: [9fans] ainc() 386/amd64 differences

2014-05-14 Thread erik quanstrom
On Wed May 14 17:27:58 EDT 2014, quans...@quanstro.net wrote: > > int > > incref(Ref *r) > > { > > int x; > > > > x = ainc(&r->ref); > > if(x <= 0) > > panic("incref pc=%#p", getcallerpc(&r)); > > return x; > > } > > ah, yes. i'd not remembered this nice implementation. > > then your ainc is gu

Re: [9fans] ainc() 386/amd64 differences

2014-05-14 Thread erik quanstrom
> int > incref(Ref *r) > { > int x; > > x = ainc(&r->ref); > if(x <= 0) > panic("incref pc=%#p", getcallerpc(&r)); > return x; > } ah, yes. i'd not remembered this nice implementation. then your ainc is guard-free? and your Ref is struct Ref {int ref;}? also, did you decide that any reuse of t

Re: [9fans] ainc() 386/amd64 differences

2014-05-14 Thread Charles Forsyth
% cat ../port/ref.c #include "u.h" #include "../port/lib.h" #include "mem.h" #include "dat.h" #include "fns.h" int incref(Ref *r) { int x; x = ainc(&r->ref); if(x <= 0) panic("incref pc=%#p", getcallerpc(&r)); return x; } int decref(Ref *r) { int x; x = adec(&r->ref); if(x < 0) panic("decref pc

[9fans] ainc() 386/amd64 differences

2014-05-14 Thread erik quanstrom
for 386, libc has this definition for ainc TEXT ainc(SB), $0 /* int ainc(int *); */ MOVLaddr+0(FP), BX ainclp: MOVL(BX), AX MOVLAX, CX INCLCX LOCK BYTE$0x0F; BYTE $0xB1; BYTE $0x0B /* CMPXCHGL CX, (BX) */ JNZ a

Re: [9fans] Bread + note -> loss

2014-05-14 Thread erik quanstrom
On Mon May 12 12:42:21 EDT 2014, cinap_len...@felloff.net wrote: > why? if the program doesnt handle the note, then it shouldnt matter if it > clunks the biobuf or not as it will be exited by the default handler. you're right. - erik