Skip to content
Snippets Groups Projects
Commit 53358eb4 authored by Kenneth Shaw's avatar Kenneth Shaw Committed by Manish R Jain
Browse files

Fixing go1.7 compatability issues (#122)

parent f7c8ec85
Branches
No related tags found
No related merge requests found
language: go language: go
go: go:
- 1.6 - 1.6
# - tip # broken for 1.7 - tip
sudo: false sudo: false
#notifications: #notifications:
# slack: # slack:
......
...@@ -67,7 +67,7 @@ func (self *List) Pop() (rval Thing, ok bool) { ...@@ -67,7 +67,7 @@ func (self *List) Pop() (rval Thing, ok bool) {
/* /*
Each will run i on each element. Each will run i on each element.
It returns true if the iteration was interrupted. It returns true if the iteration was interrupted.
This is the case when one of the ListIterator calls returned true, indicating This is the case when one of the ListIterator calls returned true, indicating
the iteration should be stopped. the iteration should be stopped.
...@@ -113,8 +113,8 @@ type element struct { ...@@ -113,8 +113,8 @@ type element struct {
/* /*
The next element in the list. If this pointer has the deleted flag set it means THIS element, not the next one, is deleted. The next element in the list. If this pointer has the deleted flag set it means THIS element, not the next one, is deleted.
*/ */
unsafe.Pointer Pointer unsafe.Pointer
value Thing value Thing
} }
func (self *element) next() *element { func (self *element) next() *element {
...@@ -122,7 +122,7 @@ func (self *element) next() *element { ...@@ -122,7 +122,7 @@ func (self *element) next() *element {
for next != nil { for next != nil {
nextElement := (*element)(next) nextElement := (*element)(next)
/* /*
If our next element contains &deletedElement that means WE are deleted, and If our next element contains &deletedElement that means WE are deleted, and
we can just return the next-next element. It will make it impossible to add we can just return the next-next element. It will make it impossible to add
stuff to us, since we will always lie about our next(), but then again, deleted stuff to us, since we will always lie about our next(), but then again, deleted
elements shouldn't get new children anyway. elements shouldn't get new children anyway.
......
package gotomic package gotomic
import ( import (
"bytes"
"fmt" "fmt"
"sort" "sort"
"sync/atomic" "sync/atomic"
"bytes"
"unsafe" "unsafe"
) )
...@@ -32,7 +32,7 @@ type Handle struct { ...@@ -32,7 +32,7 @@ type Handle struct {
/* /*
Will point to a version. Will point to a version.
*/ */
unsafe.Pointer Pointer unsafe.Pointer
} }
/* /*
...@@ -101,10 +101,10 @@ func (self writes) Less(i, j int) bool { ...@@ -101,10 +101,10 @@ func (self writes) Less(i, j int) bool {
It has a few tweaks that I don't believe break it (but I haven't even tried proving it): It has a few tweaks that I don't believe break it (but I haven't even tried proving it):
1) It has an ever increasing counter for the last transaction to commit. 1) It has an ever increasing counter for the last transaction to commit.
It uses this counter to fail transactions fast when they try to read a value that another It uses this counter to fail transactions fast when they try to read a value that another
transaction has changed since the first transaction began. transaction has changed since the first transaction began.
2) It copies the data not only on write opening, but also on read opening. 2) It copies the data not only on write opening, but also on read opening.
......
...@@ -45,10 +45,10 @@ ...@@ -45,10 +45,10 @@
"revisionTime": "2015-11-24T22:32:07Z" "revisionTime": "2015-11-24T22:32:07Z"
}, },
{ {
"checksumSHA1": "+o8IunxLKImqyhMUgJ4FCkRIAhA=", "checksumSHA1": "0JL5ZeTzdHwXRYojBJHC06AnnBs=",
"path": "github.com/zond/gotomic", "path": "github.com/zond/gotomic",
"revision": "5b217c5578228ff3979c9f9459959176fb54c388", "revision": "25c7c0a9f89b58b13a08c2bb531363fa117159c2",
"revisionTime": "2013-07-06T14:15:31Z" "revisionTime": "2016-06-26T07:37:22Z"
}, },
{ {
"checksumSHA1": "9jjO5GjLa0XF/nfWihF02RoH4qc=", "checksumSHA1": "9jjO5GjLa0XF/nfWihF02RoH4qc=",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment