Skip to content

Commit 9682400

Browse files
committed
* comment, clean up scheduler
* rewrite lock implementation to be correct (tip: never assume that an algorithm you found in a linux man page is correct.) * delete unneeded void* arg from clone fn * replace Rendez with Note * comment mal better * use 6c -w, fix warnings * mark all assembly functions 7 R=r DELTA=828 (338 added, 221 deleted, 269 changed) OCL=13884 CL=13886
1 parent 5adbacb commit 9682400

14 files changed

+541
-425
lines changed

src/runtime/Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ clean:
4949
rm -f *.$(O) *.a runtime.acid
5050

5151
%.$O: %.c
52-
$(CC) $<
52+
$(CC) -w $<
5353

5454
sys_file.$O: sys_file.c sys_types.h $(OS_H)
55-
$(CC) -D$(GOARCH)_$(GOOS) $<
55+
$(CC) -w -D$(GOARCH)_$(GOOS) $<
5656

5757
%.$O: %.s
5858
$(AS) $<

src/runtime/amd64_linux.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,6 @@ struct stat {
4848

4949
// Linux-specific system calls
5050
int64 futex(uint32*, int32, uint32, struct timespec*, uint32*, uint32);
51-
int64 clone(int32, void*, M*, G*, void(*)(void*), void*);
51+
int64 clone(int32, void*, M*, G*, void(*)(void));
5252
int64 select(int32, void*, void*, void*, void*);
5353

src/runtime/chan.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ sys·selectgo(Select *sel)
487487
SudoG *sg;
488488
G *gp;
489489

490-
byte *ae, *as;
490+
byte *as;
491491

492492
if(xxx) {
493493
prints("selectgo: sel=");
@@ -630,6 +630,8 @@ sys·selectgo(Select *sel)
630630
asynr:
631631
asyns:
632632
throw("asyn");
633+
return; // compiler doesn't know throw doesn't return
634+
633635
gotr:
634636
// recv path to wakeup the sender (sg)
635637
if(xxx) {

src/runtime/map.c

-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,6 @@ sys·mapassign(Hmap *m, byte *ak, byte *av)
199199
void
200200
sys·mapassign1(Hmap *m, ...)
201201
{
202-
Link **ll;
203202
byte *ak, *av;
204203

205204
ak = (byte*)&m + m->ko;

src/runtime/print.c

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
void
99
dump(byte *p, int32 n)
1010
{
11-
uint32 v;
1211
int32 i;
1312

1413
for(i=0; i<n; i++) {

0 commit comments

Comments
 (0)