Files
jehanne/sys/src/kern/port/ref.c
Giacomo Tesio c7d0f621c9 Clarify Forsyth's and 9front's copyrights
I'm very grateful to Charles Forsyth for creating most of Jehanne's kernel
and to 9front's guys for all the code and ideas they freely share.

Here I make their copyrights explicit as they had been erroneusly omitted
or messed up before. Sorry.
2018-01-05 02:30:45 +01:00

31 lines
434 B
C

/* Copyright (C) Charles Forsyth
* See /doc/license/NOTICE.Plan9-9k.txt for details about the licensing.
*/
#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());
return x;
}
int
decref(Ref *r)
{
int x;
x = adec(&r->ref);
if(x < 0)
panic("decref pc=%#p", getcallerpc());
return x;
}