projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
gdb: add target_ops::supports_displaced_step
[deliverable/binutils-gdb.git]
/
libiberty
/
alloca.c
diff --git
a/libiberty/alloca.c
b/libiberty/alloca.c
index 866344429df24d88bbc5f167e88987bc12da6c4d..9b2e9cb12b63b494b2de76ba74ec9a04629e8202 100644
(file)
--- a/
libiberty/alloca.c
+++ b/
libiberty/alloca.c
@@
-57,9
+57,15
@@
the possibility of a GCC built-in function.
/* These variables are used by the ASTRDUP implementation that relies
on C_alloca. */
/* These variables are used by the ASTRDUP implementation that relies
on C_alloca. */
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
const char *libiberty_optr;
char *libiberty_nptr;
unsigned long libiberty_len;
const char *libiberty_optr;
char *libiberty_nptr;
unsigned long libiberty_len;
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
/* If your stack is a linked list of frames, you have to
provide an "address metric" ADDRESS_FUNCTION macro. */
/* If your stack is a linked list of frames, you have to
provide an "address metric" ADDRESS_FUNCTION macro. */
@@
-191,20
+197,20
@@
C_alloca (size_t size)
/* Allocate combined header + user data storage. */
{
/* Allocate combined header + user data storage. */
{
- register
PTR new = xmalloc (
sizeof (header) + size);
+ register
void *new_storage = XNEWVEC (char,
sizeof (header) + size);
/* Address of header. */
/* Address of header. */
- if (new == 0)
+ if (new
_storage
== 0)
abort();
abort();
- ((header *) new)->h.next = last_alloca_header;
- ((header *) new)->h.deep = depth;
+ ((header *) new
_storage
)->h.next = last_alloca_header;
+ ((header *) new
_storage
)->h.deep = depth;
- last_alloca_header = (header *) new;
+ last_alloca_header = (header *) new
_storage
;
/* User storage begins just after header. */
/* User storage begins just after header. */
- return (PTR) ((char *) new + sizeof (header));
+ return (PTR) ((char *) new
_storage
+ sizeof (header));
}
}
}
}
This page took
0.02496 seconds
and
4
git commands to generate.