Skip to content

Commit

Permalink
Fix build failure on Windows/386
Browse files Browse the repository at this point in the history
The array size exceeds the address space of 32-bit platform.
See #238
  • Loading branch information
Mura Li committed Oct 23, 2018
1 parent f3aa5ce commit d12a138
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sqlite3_opt_unlock_notify.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ extern void unlock_notify_callback(void *arg, int argc);
import "C"
import (
"fmt"
"math"
"sync"
"unsafe"
)
Expand Down Expand Up @@ -59,7 +60,7 @@ func (t *unlock_notify_table) get(h uint) chan struct{} {
//export unlock_notify_callback
func unlock_notify_callback(argv unsafe.Pointer, argc C.int) {
for i := 0; i < int(argc); i++ {
parg := ((*(*[1 << 30]*[1]uint)(argv))[i])
parg := ((*(*[(math.MaxInt32 - 1) / unsafe.Sizeof(uintptr)]*[1]uint)(argv))[i])
arg := *parg
h := arg[0]
c := unt.get(h)
Expand Down

0 comments on commit d12a138

Please # to comment.