Skip to content

Commit ed1cb1d

Browse files
committed
Reduce max size of arrays for 32-bit compile
1 parent ffb6d50 commit ed1cb1d

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

discon-client/client.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ func init() {
8484
func DISCON(avrSwap *C.float, aviFail *C.int, accInFile, avcOutName, avcMsg *C.char) {
8585

8686
// Get first 130 entries of swap array
87-
swap := (*[1 << 30]float32)(unsafe.Pointer(avrSwap))
87+
swap := (*[1 << 24]float32)(unsafe.Pointer(avrSwap))
8888

8989
// Get array sizes
9090
swapSize := int(swap[128]) // Maximum size of swap array
@@ -106,9 +106,9 @@ func DISCON(avrSwap *C.float, aviFail *C.int, accInFile, avcOutName, avcMsg *C.c
106106

107107
payload.Swap = swap[:swapSize:swapSize]
108108
payload.Fail = int32(*aviFail)
109-
payload.InFile = (*[1 << 30]byte)(unsafe.Pointer(accInFile))[:inFileSize:inFileSize]
110-
payload.OutName = (*[1 << 30]byte)(unsafe.Pointer(avcOutName))[:outNameSize:outNameSize]
111-
payload.Msg = (*[1 << 30]byte)(unsafe.Pointer(avcMsg))[:msgSize:msgSize]
109+
payload.InFile = (*[1 << 24]byte)(unsafe.Pointer(accInFile))[:inFileSize:inFileSize]
110+
payload.OutName = (*[1 << 24]byte)(unsafe.Pointer(avcOutName))[:outNameSize:outNameSize]
111+
payload.Msg = (*[1 << 24]byte)(unsafe.Pointer(avcMsg))[:msgSize:msgSize]
112112

113113
// Convert payload to binary and send over websocket
114114
b, err := payload.MarshalBinary()

0 commit comments

Comments
 (0)