github.com/primecitizens/pcz/std@v0.2.1/core/alloc/sbrkalloc/utils.go (about) 1 // SPDX-License-Identifier: Apache-2.0 2 // Copyright 2023 The Prime Citizens 3 // 4 // Copyright 2014 The Go Authors. All rights reserved. 5 // Use of this source code is governed by a BSD-style 6 // license that can be found in the LICENSE file. 7 8 package sbrkalloc 9 10 // divRoundUp returns ceil(n / a). 11 func divRoundUp(n, a uintptr) uintptr { 12 // a is generally a power of two. This will get inlined and 13 // the compiler will optimize the division. 14 return (n + a - 1) / a 15 }