Commit 4495b77a authored by Barry Perlman's avatar Barry Perlman Committed by Yoni Fogel

[t:3092] Avoid function call for common case.

git-svn-id: file:///svn/toku/tokudb@26164 c7de825b-a66e-492c-adef-691d508d4ae1
parent 11d74f29
...@@ -78,6 +78,7 @@ toku_free_n(void* p, size_t size __attribute__((unused))) ...@@ -78,6 +78,7 @@ toku_free_n(void* p, size_t size __attribute__((unused)))
void * void *
toku_xmalloc(size_t size) { toku_xmalloc(size_t size) {
void *r = toku_malloc(size); void *r = toku_malloc(size);
if (r == 0) // avoid function call in common case
resource_assert(r); resource_assert(r);
return r; return r;
} }
...@@ -95,6 +96,7 @@ void * ...@@ -95,6 +96,7 @@ void *
toku_xrealloc(void *v, size_t size) toku_xrealloc(void *v, size_t size)
{ {
void *r = toku_realloc(v, size); void *r = toku_realloc(v, size);
if (r == 0) // avoid function call in common case
resource_assert(r); resource_assert(r);
return r; return r;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment