summaryrefslogtreecommitdiffstats
path: root/vendor/modernc.org/ccgo/v3/lib/mem_linux.go
blob: 25612c6b1a35cb536f596f1f0c078c232fbe7303 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Copyright 2020 The CCGO Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package ccgo // import "modernc.org/ccgo/v3/lib"

import (
	"golang.org/x/sys/unix"
)

var totalRam uint64

func init() {
	var si unix.Sysinfo_t
	if unix.Sysinfo(&si) != nil {
		return
	}

	totalRam = uint64(si.Totalram)
}