1 // Copyright 2016 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
7 // Check that calls to C.malloc/C.free do not collide with the calls
8 // made by the os/user package.
10 // #cgo CFLAGS: -fsanitize=thread
11 // #cgo LDFLAGS: -fsanitize=thread
12 // #include <stdlib.h>
24 u, err := user.Current()
26 fmt.Fprintln(os.Stderr, err)
32 for i := 0; i < 20; i++ {
36 for i := 0; i < 1000; i++ {
37 user.Lookup(u.Username)
43 for i := 0; i < 1000; i++ {
44 p := C.malloc(C.size_t(len(u.Username) + 1))