projects
/
ust.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Change malloc to zmalloc for libust
[ust.git]
/
libust
/
tracepoint.c
diff --git
a/libust/tracepoint.c
b/libust/tracepoint.c
index 620a009cf333539fe5bd263fadd4ba0f762351ba..8783b53084971074bd2ac60a45527dd17505aad1 100644
(file)
--- a/
libust/tracepoint.c
+++ b/
libust/tracepoint.c
@@
-74,7
+74,7
@@
struct tp_probes {
static inline void *allocate_probes(int count)
{
static inline void *allocate_probes(int count)
{
- struct tp_probes *p =
malloc(count * sizeof(struct probe
)
+ struct tp_probes *p =
zmalloc(count * sizeof(void *
)
+ sizeof(struct tp_probes));
return p == NULL ? NULL : p->probes;
}
+ sizeof(struct tp_probes));
return p == NULL ? NULL : p->probes;
}
@@
-225,10
+225,10
@@
static struct tracepoint_entry *add_tracepoint(const char *name)
}
}
/*
}
}
/*
- * Using
k
malloc here to allocate a variable length element. Could
+ * Using
z
malloc here to allocate a variable length element. Could
* cause some memory fragmentation if overused.
*/
* cause some memory fragmentation if overused.
*/
- e = malloc(sizeof(struct tracepoint_entry) + name_len);
+ e =
z
malloc(sizeof(struct tracepoint_entry) + name_len);
if (!e)
return ERR_PTR(-ENOMEM);
memcpy(&e->name[0], name, name_len);
if (!e)
return ERR_PTR(-ENOMEM);
memcpy(&e->name[0], name, name_len);
@@
-661,7
+661,7
@@
int tracepoint_register_lib(struct tracepoint *tracepoints_start, int tracepoint
{
struct tracepoint_lib *pl;
{
struct tracepoint_lib *pl;
- pl = (struct tracepoint_lib *) malloc(sizeof(struct tracepoint_lib));
+ pl = (struct tracepoint_lib *)
z
malloc(sizeof(struct tracepoint_lib));
pl->tracepoints_start = tracepoints_start;
pl->tracepoints_count = tracepoints_count;
pl->tracepoints_start = tracepoints_start;
pl->tracepoints_count = tracepoints_count;
This page took
0.022792 seconds
and
4
git commands to generate.