Skip to content

Commit

Permalink
Merge remote-tracking branch 'couchbase/unstable' into master
Browse files Browse the repository at this point in the history
Change-Id: I4e9dedb25e50ebcd581441988c3fff0142f6a92a
  • Loading branch information
jliang00 committed Jul 16, 2021
2 parents 89c78ce + f95b298 commit 11d883d
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion nitro.go
Expand Up @@ -311,7 +311,7 @@ func (cfg *Config) SetKeyComparator(cmp KeyCompare) {

// UseMemoryMgmt provides custom memory allocator for Nitro items storage
func (cfg *Config) UseMemoryMgmt(malloc skiplist.MallocFn, free skiplist.FreeFn) {
if runtime.GOARCH == "amd64" {
if runtime.GOARCH == "amd64" || runtime.GOARCH == "arm64" {
cfg.useMemoryMgmt = true
cfg.mallocFun = malloc
cfg.freeFun = free
Expand Down
2 changes: 1 addition & 1 deletion skiplist/node.go
@@ -1,4 +1,4 @@
// +build !amd64
// +build !amd64,!arm64

// Copyright (c) 2016 Couchbase, Inc.
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
Expand Down
@@ -1,3 +1,5 @@
// +build amd64 arm64
//
// Copyright (c) 2016 Couchbase, Inc.
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
// except in compliance with the License. You may obtain a copy of the License at
Expand Down
2 changes: 2 additions & 0 deletions skiplist/node_amd64.go → skiplist/node_multi_arch.go
@@ -1,3 +1,5 @@
// +build amd64 arm64

// Copyright (c) 2016 Couchbase, Inc.
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
// except in compliance with the License. You may obtain a copy of the License at
Expand Down
2 changes: 1 addition & 1 deletion skiplist/skiplist.go
Expand Up @@ -83,7 +83,7 @@ func New() *Skiplist {

// NewWithConfig creates a config from given config
func NewWithConfig(cfg Config) *Skiplist {
if runtime.GOARCH != "amd64" {
if runtime.GOARCH != "amd64" && runtime.GOARCH != "arm64" {
cfg.UseMemoryMgmt = false
}

Expand Down

0 comments on commit 11d883d

Please sign in to comment.