Plan 9 from Bell Labs’s /usr/web/sources/contrib/rsc/linuxemu/libc/port/malloc.acid

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


sizeof_1_ = 8;
aggr _1_
{
	'V' 0 length;
};

defn
_1_(addr) {
	complex _1_ addr;
	print("	length	", addr.length, "\n");
};

UTFmax = 3;
Runesync = 128;
Runeself = 128;
Runeerror = 128;
sizeofFconv = 24;
aggr Fconv
{
	'X' 0 out;
	'X' 4 eout;
	'D' 8 f1;
	'D' 12 f2;
	'D' 16 f3;
	'D' 20 chr;
};

defn
Fconv(addr) {
	complex Fconv addr;
	print("	out	", addr.out\X, "\n");
	print("	eout	", addr.eout\X, "\n");
	print("	f1	", addr.f1, "\n");
	print("	f2	", addr.f2, "\n");
	print("	f3	", addr.f3, "\n");
	print("	chr	", addr.chr, "\n");
};

sizeofTm = 40;
aggr Tm
{
	'D' 0 sec;
	'D' 4 min;
	'D' 8 hour;
	'D' 12 mday;
	'D' 16 mon;
	'D' 20 year;
	'D' 24 wday;
	'D' 28 yday;
	'a' 32 zone;
	'D' 36 tzoff;
};

defn
Tm(addr) {
	complex Tm addr;
	print("	sec	", addr.sec, "\n");
	print("	min	", addr.min, "\n");
	print("	hour	", addr.hour, "\n");
	print("	mday	", addr.mday, "\n");
	print("	mon	", addr.mon, "\n");
	print("	year	", addr.year, "\n");
	print("	wday	", addr.wday, "\n");
	print("	yday	", addr.yday, "\n");
	print("	zone	", addr.zone, "\n");
	print("	tzoff	", addr.tzoff, "\n");
};

PNPROC = 1;
PNGROUP = 2;
sizeofLock = 4;
aggr Lock
{
	'D' 0 val;
};

defn
Lock(addr) {
	complex Lock addr;
	print("	val	", addr.val, "\n");
};

sizeofQLp = 12;
aggr QLp
{
	'D' 0 inuse;
	'A' QLp 4 next;
	'C' 8 state;
};

defn
QLp(addr) {
	complex QLp addr;
	print("	inuse	", addr.inuse, "\n");
	print("	next	", addr.next\X, "\n");
	print("	state	", addr.state, "\n");
};

sizeofQLock = 16;
aggr QLock
{
	Lock 0 lock;
	'D' 4 locked;
	'A' QLp 8 $head;
	'A' QLp 12 $tail;
};

defn
QLock(addr) {
	complex QLock addr;
	print("Lock lock {\n");
	Lock(addr.lock);
	print("}\n");
	print("	locked	", addr.locked, "\n");
	print("	$head	", addr.$head\X, "\n");
	print("	$tail	", addr.$tail\X, "\n");
};

sizeofRWLock = 20;
aggr RWLock
{
	Lock 0 lock;
	'D' 4 readers;
	'D' 8 writer;
	'A' QLp 12 $head;
	'A' QLp 16 $tail;
};

defn
RWLock(addr) {
	complex RWLock addr;
	print("Lock lock {\n");
	Lock(addr.lock);
	print("}\n");
	print("	readers	", addr.readers, "\n");
	print("	writer	", addr.writer, "\n");
	print("	$head	", addr.$head\X, "\n");
	print("	$tail	", addr.$tail\X, "\n");
};

RFNAMEG = 1;
RFENVG = 2;
RFFDG = 4;
RFNOTEG = 8;
RFPROC = 16;
RFMEM = 32;
RFNOWAIT = 64;
RFCNAMEG = 1024;
RFCENVG = 2048;
RFCFDG = 4096;
RFREND = 8192;
RFNOMNT = 16384;
sizeofQid = 8;
aggr Qid
{
	'U' 0 path;
	'U' 4 vers;
};

defn
Qid(addr) {
	complex Qid addr;
	print("	path	", addr.path, "\n");
	print("	vers	", addr.vers, "\n");
};

sizeofDir = 116;
aggr Dir
{
	'a' 0 name;
	'a' 28 uid;
	'a' 56 gid;
	Qid 84 qid;
	'U' 92 mode;
	'D' 96 atime;
	'D' 100 mtime;
	{
	'V' 104 length;
	};
	'u' 112 type;
	'u' 114 dev;
};

defn
Dir(addr) {
	complex Dir addr;
	print("	name	", addr.name, "\n");
	print("	uid	", addr.uid, "\n");
	print("	gid	", addr.gid, "\n");
	print("Qid qid {\n");
	Qid(addr.qid);
	print("}\n");
	print("	mode	", addr.mode, "\n");
	print("	atime	", addr.atime, "\n");
	print("	mtime	", addr.mtime, "\n");
	print("_1_ {\n");
		_1_(addr+104);
	print("}\n");
	print("	type	", addr.type, "\n");
	print("	dev	", addr.dev, "\n");
};

sizeofWaitmsg = 112;
aggr Waitmsg
{
	'a' 0 pid;
	'a' 12 time;
	'a' 48 msg;
};

defn
Waitmsg(addr) {
	complex Waitmsg addr;
	print("	pid	", addr.pid, "\n");
	print("	time	", addr.time, "\n");
	print("	msg	", addr.msg, "\n");
};

sizeofPool = 88;
aggr Pool
{
	'X' 0 name;
	'U' 4 maxsize;
	'U' 8 cursize;
	'U' 12 curfree;
	'U' 16 curalloc;
	'U' 20 minarena;
	'U' 24 quantum;
	'U' 28 minblock;
	'X' 32 freeroot;
	'X' 36 arenalist;
	'X' 40 alloc;
	'X' 44 merge;
	'X' 48 move;
	'D' 52 flags;
	'D' 56 nfree;
	'D' 60 lastcompact;
	'X' 64 lock;
	'X' 68 unlock;
	'X' 72 print;
	'X' 76 panic;
	'X' 80 logstack;
	'X' 84 private;
};

defn
Pool(addr) {
	complex Pool addr;
	print("	name	", addr.name\X, "\n");
	print("	maxsize	", addr.maxsize, "\n");
	print("	cursize	", addr.cursize, "\n");
	print("	curfree	", addr.curfree, "\n");
	print("	curalloc	", addr.curalloc, "\n");
	print("	minarena	", addr.minarena, "\n");
	print("	quantum	", addr.quantum, "\n");
	print("	minblock	", addr.minblock, "\n");
	print("	freeroot	", addr.freeroot\X, "\n");
	print("	arenalist	", addr.arenalist\X, "\n");
	print("	alloc	", addr.alloc\X, "\n");
	print("	merge	", addr.merge\X, "\n");
	print("	move	", addr.move\X, "\n");
	print("	flags	", addr.flags, "\n");
	print("	nfree	", addr.nfree, "\n");
	print("	lastcompact	", addr.lastcompact, "\n");
	print("	lock	", addr.lock\X, "\n");
	print("	unlock	", addr.unlock\X, "\n");
	print("	print	", addr.print\X, "\n");
	print("	panic	", addr.panic\X, "\n");
	print("	logstack	", addr.logstack\X, "\n");
	print("	private	", addr.private\X, "\n");
};

complex Pool mainmem;
complex Pool imagmem;
POOL_ANTAGONISM = 1;
POOL_PARANOIA = 2;
POOL_VERBOSITY = 4;
POOL_DEBUGGING = 8;
POOL_LOGGING = 16;
POOL_TOLERANCE = 32;
sizeofPrivate = 20;
aggr Private
{
	QLock 0 lk;
	'D' 16 printfd;
};

defn
Private(addr) {
	complex Private addr;
	print("QLock lk {\n");
	QLock(addr.lk);
	print("}\n");
	print("	printfd	", addr.printfd, "\n");
};

complex Private sbrkmempriv;
complex Pool sbrkmem;
complex Pool mainmem;
complex Pool imagmem;
complex Pool plock:p;
complex Private plock:pv;
complex Pool punlock:p;
complex Private punlock:pv;
complex Pool pprint:p;
complex Private pprint:pv;
complex Pool ppanic:p;
complex Private ppanic:pv;
Npadlong = 2;
MallocOffset = 0;
ReallocOffset = 1;

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.