Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 191099
b: refs/heads/master
c: a1d37d5
h: refs/heads/master
i:
  191097: bc10a30
  191095: ebb50ef
v: v3
  • Loading branch information
Masami Hiramatsu authored and Ingo Molnar committed Mar 17, 2010
1 parent 149082c commit 2c7d121
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e4713e93b125497e9ba44d93de1bd9d8e5ad8946
refs/heads/master: a1d37d5285bcda07f9c0b80a2634ca20ab545297
9 changes: 9 additions & 0 deletions trunk/tools/perf/util/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,13 @@ extern void *xmemdupz(const void *data, size_t len);
extern char *xstrndup(const char *str, size_t len);
extern void *xrealloc(void *ptr, size_t size) __attribute__((weak));

static inline void *xzalloc(size_t size)
{
void *buf = xmalloc(size);

return memset(buf, 0, size);
}

static inline void *zalloc(size_t size)
{
return calloc(1, size);
Expand All @@ -309,6 +316,7 @@ static inline int has_extension(const char *filename, const char *ext)
{
size_t len = strlen(filename);
size_t extlen = strlen(ext);

return len > extlen && !memcmp(filename + len - extlen, ext, extlen);
}

Expand All @@ -322,6 +330,7 @@ static inline int has_extension(const char *filename, const char *ext)
#undef isalnum
#undef tolower
#undef toupper

extern unsigned char sane_ctype[256];
#define GIT_SPACE 0x01
#define GIT_DIGIT 0x02
Expand Down

0 comments on commit 2c7d121

Please sign in to comment.