repo.or.cz
/
tangerine.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Fixed binary search: no more infinite loops when vendor is unknown.
[tangerine.git]
/
compiler
/
purify
/
src
/
util.c
blob
68abedf3d6750dfc51d0ce989aa0eb03b26e8cbb
1
#include <stdlib.h>
2
#include <stdio.h>
3
#include
"util.h"
4
5
void
*
xmalloc
(
int
size
)
6
{
7
void
*
ptr
=
malloc
(
size
);
8
9
if
(!
ptr
)
10
{
11
fprintf
(
stderr
,
"Out of memory
\n
"
);
12
exit
(
20
);
13
}
14
15
return
ptr
;
16
}
17
18
void
xfree
(
void
*
ptr
)
19
{
20
if
(
ptr
)
21
free
(
ptr
);
22
else
23
fprintf
(
stderr
,
"Warning: free (NULL);
\n
"
);
24
}