| 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. |
| 4 |
|
| 5 |
//go:build unix || windows |
| 6 |
|
| 7 |
#include "libcgo.h" |
| 8 |
|
| 9 |
// Releases the cgo traceback context. |
| 10 |
void _cgo_release_context(uintptr_t ctxt) { |
| 11 |
void (*pfn)(struct cgoContextArg*); |
| 12 |
|
| 13 |
pfn = _cgo_get_context_function(); |
| 14 |
if (ctxt != 0 && pfn != nil) { |
| 15 |
struct cgoContextArg arg; |
| 16 |
|
| 17 |
arg.Context = ctxt; |
| 18 |
(*pfn)(&arg); |
| 19 |
} |
| 20 |
} |