Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
2e7e3e1d
Commit
2e7e3e1d
authored
Jan 11, 2011
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add file missed in previous commit.
From-SVN: r168684
parent
4053a5a0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
0 deletions
+42
-0
libgo/runtime/go-cgo.c
+42
-0
No files found.
libgo/runtime/go-cgo.c
0 → 100644
View file @
2e7e3e1d
/* go-cgo.c -- SWIG support routines for libgo.
Copyright 2011 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file. */
#include "go-alloc.h"
#include "interface.h"
#include "go-panic.h"
#include "go-string.h"
/* These are routines used by SWIG. The gc runtime library provides
the same routines under the same name, though in that case the code
is required to import runtime/cgo. */
void
*
_cgo_allocate
(
size_t
n
)
{
return
__go_alloc
(
n
);
}
extern
const
struct
__go_type_descriptor
string_type_descriptor
asm
(
"__go_tdn_string"
);
void
_cgo_panic
(
const
char
*
p
)
{
int
len
;
unsigned
char
*
data
;
struct
__go_string
*
ps
;
struct
__go_empty_interface
e
;
len
=
__builtin_strlen
(
p
);
data
=
__go_alloc
(
len
);
__builtin_memcpy
(
data
,
p
,
len
);
ps
=
__go_alloc
(
sizeof
*
ps
);
ps
->
__data
=
data
;
ps
->
__length
=
len
;
e
.
__type_descriptor
=
&
string_type_descriptor
;
e
.
__object
=
ps
;
__go_panic
(
e
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment