Browse Source

lib/db: Fix alignment crash on 32 bit platforms

Fixes #3347
Fixes #3348
Fixes #3349

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3350
Jakob Borg 9 years ago
parent
commit
d57e6808cc
1 changed files with 1 additions and 1 deletions
  1. 1 1
      lib/db/leveldb_dbinstance.go

+ 1 - 1
lib/db/leveldb_dbinstance.go

@@ -29,10 +29,10 @@ import (
 type deletionHandler func(t readWriteTransaction, folder, device, name []byte, dbi iterator.Iterator) int64
 type deletionHandler func(t readWriteTransaction, folder, device, name []byte, dbi iterator.Iterator) int64
 
 
 type Instance struct {
 type Instance struct {
+	committed int64 // this must be the first attribute in the struct to ensure 64 bit alignment on 32 bit plaforms
 	*leveldb.DB
 	*leveldb.DB
 	folderIdx *smallIndex
 	folderIdx *smallIndex
 	deviceIdx *smallIndex
 	deviceIdx *smallIndex
-	committed int64
 }
 }
 
 
 const (
 const (