Skip to content

Commit

Permalink
Merge pull request #10 from mjschwenne/grackle
Browse files Browse the repository at this point in the history
Swap Marshal args order
  • Loading branch information
upamanyus authored Jan 29, 2025
2 parents f2e9027 + d741436 commit 40b8ad1
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 21 deletions.
10 changes: 5 additions & 5 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
src = pkgs.fetchFromGitHub {
owner = "goose-lang";
repo = "goose";
rev = "a4f2f84193d34f56dd84fc623adc43a6441da1eb";
sha256 = "1b1dfa1qsv2h7hy5x20zhic2npr5gz1zp76m1lab4v490adxj2rx";
rev = "67cf95ebfc80e80ddc40b0518e6d761cde44977c";
sha256 = "16040c4frxn9dk3xmajzg4jb7fi7q39hasfp94rpnphmpr4hvr51";
};
vendorHash = "sha256-HCJ8v3TSv4UrkOsRuENWVz5Z7zQ1UsOygx0Mo7MELzY=";
};
Expand All @@ -27,10 +27,10 @@
src = pkgs.fetchFromGitHub {
owner = "mjschwenne";
repo = "grackle";
rev = "101412356cdfbcad78f8aaa724101312928c4978";
sha256 = "06zf2bvrbbjhgrd6994h3wcaml7m83m6f9r61pj7y09xq9nw10br";
rev = "3a83c3b22f163da77d75bfdb3923f007af2ad515";
sha256 = "1bl8lx50qhl6yczjnwfwywx29nvinr20v2zjdc2zjqi8kcls7kqr";
};
vendorHash = "sha256-Wk2v0HSAkrzxHJvCfbw6xOn0OQ1xukvYjDxk3c2LmH8=";
vendorHash = "sha256-c9+npmcdynfqSnxEZSdubVeN8Y3eYAwjya52vTJayY0=";
checkPhase = false;
};
in
Expand Down
2 changes: 1 addition & 1 deletion tutorial/kvservice/conditionalput_gk/conditionalput_gk.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type S struct {
NewVal string
}

func Marshal(c S, prefix []byte) []byte {
func Marshal(prefix []byte, c S) []byte {
var enc = prefix

enc = marshal.WriteInt(enc, c.OpId)
Expand Down
2 changes: 1 addition & 1 deletion tutorial/kvservice/get_gk/get_gk.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type S struct {
Key string
}

func Marshal(g S, prefix []byte) []byte {
func Marshal(prefix []byte, g S) []byte {
var enc = prefix

enc = marshal.WriteInt(enc, g.OpId)
Expand Down
6 changes: 3 additions & 3 deletions tutorial/kvservice/kvservice_rpc.gb.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (cl *Client) getFreshNumRpc() (uint64, Error) {

func (cl *Client) putRpc(args put_gk.S) Error {
var reply []byte
err := cl.cl.Call(rpcIdPut, put_gk.Marshal(args, make([]byte, 0)), &reply, 100)
err := cl.cl.Call(rpcIdPut, put_gk.Marshal(make([]byte, 0), args), &reply, 100)
if err == urpc.ErrNone {
return err
}
Expand All @@ -41,7 +41,7 @@ func (cl *Client) putRpc(args put_gk.S) Error {

func (cl *Client) conditionalPutRpc(args conditionalput_gk.S) (string, Error) {
var reply []byte
err := cl.cl.Call(rpcIdConditionalPut, conditionalput_gk.Marshal(args, make([]byte, 0)), &reply, 100)
err := cl.cl.Call(rpcIdConditionalPut, conditionalput_gk.Marshal(make([]byte, 0), args), &reply, 100)
if err == urpc.ErrNone {
return string(reply), err
}
Expand All @@ -50,7 +50,7 @@ func (cl *Client) conditionalPutRpc(args conditionalput_gk.S) (string, Error) {

func (cl *Client) getRpc(args get_gk.S) (string, Error) {
var reply []byte
err := cl.cl.Call(rpcIdGet, get_gk.Marshal(args, make([]byte, 0)), &reply, 100)
err := cl.cl.Call(rpcIdGet, get_gk.Marshal(make([]byte, 0), args), &reply, 100)
if err == urpc.ErrNone {
return string(reply), err
}
Expand Down
2 changes: 1 addition & 1 deletion tutorial/kvservice/put_gk/put_gk.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type S struct {
Value string
}

func Marshal(p S, prefix []byte) []byte {
func Marshal(prefix []byte, p S) []byte {
var enc = prefix

enc = marshal.WriteInt(enc, p.OpId)
Expand Down
4 changes: 2 additions & 2 deletions tutorial/lockservice/1_lock_rpc.gb.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func (cl *Client) getFreshNum() (uint64, Error) {

func (cl *Client) tryAcquire(id uint64) (uint64, Error) {
var reply []byte
args := lockrequest_gk.Marshal(lockrequest_gk.S{Id: id}, []byte{})
args := lockrequest_gk.Marshal([]byte{}, lockrequest_gk.S{Id: id})
err := cl.cl.Call(RPC_TRY_ACQUIRE, args, &reply, 100)
if err == urpc.ErrNone {
return DecodeUint64(reply), err
Expand All @@ -40,7 +40,7 @@ func (cl *Client) tryAcquire(id uint64) (uint64, Error) {

func (cl *Client) release(id uint64) Error {
var reply []byte
args := lockrequest_gk.Marshal(lockrequest_gk.S{Id: id}, []byte{})
args := lockrequest_gk.Marshal([]byte{}, lockrequest_gk.S{Id: id})
return cl.cl.Call(RPC_RELEASE, args, &reply, 100)
}

Expand Down
2 changes: 1 addition & 1 deletion tutorial/lockservice/lockrequest_gk/lockrequest_gk.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type S struct {
Id uint64
}

func Marshal(l S, prefix []byte) []byte {
func Marshal(prefix []byte, l S) []byte {
var enc = prefix

enc = marshal.WriteInt(enc, l.Id)
Expand Down
2 changes: 1 addition & 1 deletion tutorial/objectstore/chunk/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type ClerkPool struct {
}

func (ck *ClerkPool) WriteChunk(addr grove_ffi.Address, args writechunk_gk.S) {
req := writechunk_gk.Marshal(args, make([]byte, 0))
req := writechunk_gk.Marshal(make([]byte, 0), args)
reply := new([]byte)
ck.cm.CallAtLeastOnce(addr, WriteChunkId, req, reply, 100 /*ms*/)
}
Expand Down
2 changes: 1 addition & 1 deletion tutorial/objectstore/chunk/writechunk_gk/writechunk_gk.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type S struct {
Index uint64
}

func Marshal(w S, prefix []byte) []byte {
func Marshal(prefix []byte, w S) []byte {
var enc = prefix

enc = marshal.WriteInt(enc, w.WriteId)
Expand Down
2 changes: 1 addition & 1 deletion tutorial/objectstore/dir/chunkhandle_gk/chunkhandle_gk.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type S struct {
ContentHash string
}

func Marshal(c S, prefix []byte) []byte {
func Marshal(prefix []byte, c S) []byte {
var enc = prefix

enc = marshal.WriteInt(enc, c.Addr)
Expand Down
4 changes: 2 additions & 2 deletions tutorial/objectstore/dir/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ func (ck *Clerk) PrepareWrite() PreparedWrite {

// From chunk
func (ck *Clerk) RecordChunk(args recordchunk_gk.S) {
req := recordchunk_gk.Marshal(args, make([]byte, 0))
req := recordchunk_gk.Marshal(make([]byte, 0), args)
reply := new([]byte)
ck.client.Call(RecordChunkId, req, reply, 100 /*ms*/)
}

// From chunk
func (ck *Clerk) FinishWrite(args finishwrite_gk.S) {
req := finishwrite_gk.Marshal(args, make([]byte, 0))
req := finishwrite_gk.Marshal(make([]byte, 0), args)
reply := new([]byte)
ck.client.Call(FinishWriteId, req, reply, 100 /*ms*/)
}
Expand Down
2 changes: 1 addition & 1 deletion tutorial/objectstore/dir/finishwrite_gk/finishwrite_gk.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type S struct {
Keyname string
}

func Marshal(f S, prefix []byte) []byte {
func Marshal(prefix []byte, f S) []byte {
var enc = prefix

enc = marshal.WriteInt(enc, f.WriteId)
Expand Down
2 changes: 1 addition & 1 deletion tutorial/objectstore/dir/recordchunk_gk/recordchunk_gk.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type S struct {
Index uint64
}

func Marshal(r S, prefix []byte) []byte {
func Marshal(prefix []byte, r S) []byte {
var enc = prefix

enc = marshal.WriteInt(enc, r.WriteId)
Expand Down

0 comments on commit 40b8ad1

Please sign in to comment.