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
bb99744f
Commit
bb99744f
authored
20 years ago
by
Kaveh R. Ghazi
Committed by
Kaveh Ghazi
20 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* xmemdup.c, xstrdup.c: Expose the tail call.
From-SVN: r97033
parent
cba9e10a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
4 deletions
+14
-4
libiberty/ChangeLog
+4
-0
libiberty/xmemdup.c
+5
-2
libiberty/xstrdup.c
+5
-2
No files found.
libiberty/ChangeLog
View file @
bb99744f
2005-03-24 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* xmemdup.c, xstrdup.c: Expose the tail call.
2005-03-09 Mark Mitchell <mark@codesourcery.com>
* configure.ac (funcs): Add gettimeofday.
...
...
This diff is collapsed.
Click to expand it.
libiberty/xmemdup.c
View file @
bb99744f
...
...
@@ -24,6 +24,10 @@ allocated, the remaining memory is zeroed.
#include <sys/types.h>
/* For size_t. */
#ifdef HAVE_STRING_H
#include <string.h>
#else
# ifdef HAVE_STRINGS_H
# include <strings.h>
# endif
#endif
PTR
...
...
@@ -33,6 +37,5 @@ xmemdup (input, copy_size, alloc_size)
size_t
alloc_size
;
{
PTR
output
=
xcalloc
(
1
,
alloc_size
);
memcpy
(
output
,
input
,
copy_size
);
return
output
;
return
(
PTR
)
memcpy
(
output
,
input
,
copy_size
);
}
This diff is collapsed.
Click to expand it.
libiberty/xstrdup.c
View file @
bb99744f
...
...
@@ -19,6 +19,10 @@ obtain memory.
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#else
# ifdef HAVE_STRINGS_H
# include <strings.h>
# endif
#endif
#include "ansidecl.h"
#include "libiberty.h"
...
...
@@ -29,6 +33,5 @@ xstrdup (s)
{
register
size_t
len
=
strlen
(
s
)
+
1
;
register
char
*
ret
=
xmalloc
(
len
);
memcpy
(
ret
,
s
,
len
);
return
ret
;
return
(
char
*
)
memcpy
(
ret
,
s
,
len
);
}
This diff is collapsed.
Click to expand it.
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