Skip to content

Commit 9f3904a

Browse files
ajsuttonRaduBerinde
authored andcommitted
internal/manual,internal/rawalloc: Reduce max array size to support MIPS.
1 parent 6803ae8 commit 9f3904a

File tree

4 files changed

+39
-4
lines changed

4 files changed

+39
-4
lines changed

internal/manual/manual_32bit.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// of this source code is governed by a BSD-style license that can be found in
33
// the LICENSE file.
44

5-
//go:build 386 || amd64p32 || arm || armbe || mips || mipsle || mips64p32 || mips64p32le || ppc || sparc
6-
// +build 386 amd64p32 arm armbe mips mipsle mips64p32 mips64p32le ppc sparc
5+
//go:build 386 || amd64p32 || arm || armbe || ppc || sparc
6+
// +build 386 amd64p32 arm armbe ppc sparc
77

88
package manual
99

internal/manual/manual_mips.go

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright 2020 The LevelDB-Go and Pebble Authors. All rights reserved. Use
2+
// of this source code is governed by a BSD-style license that can be found in
3+
// the LICENSE file.
4+
5+
//go:build mips || mipsle || mips64p32 || mips64p32le
6+
// +build mips mipsle mips64p32 mips64p32le
7+
8+
package manual
9+
10+
const (
11+
// MaxArrayLen is a safe maximum length for slices on this architecture.
12+
MaxArrayLen = 1 << 30
13+
)

internal/rawalloc/rawalloc_32bit.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// implied. See the License for the specific language governing
1313
// permissions and limitations under the License.
1414

15-
//go:build 386 || amd64p32 || arm || armbe || mips || mipsle || mips64p32 || mips64p32le || ppc || sparc
16-
// +build 386 amd64p32 arm armbe mips mipsle mips64p32 mips64p32le ppc sparc
15+
//go:build 386 || amd64p32 || arm || armbe || ppc || sparc
16+
// +build 386 amd64p32 arm armbe ppc sparc
1717

1818
package rawalloc
1919

internal/rawalloc/rawalloc_mips.go

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright 2014 The Cockroach Authors.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
12+
// implied. See the License for the specific language governing
13+
// permissions and limitations under the License.
14+
15+
//go:build mips || mipsle || mips64p32 || mips64p32le
16+
// +build mips mipsle mips64p32 mips64p32le
17+
18+
package rawalloc
19+
20+
const (
21+
maxArrayLen = 1 << 30
22+
)

0 commit comments

Comments
 (0)