Commit e31baa84 authored by marko's avatar marko

branches/zip: Make innodb_use_sys_malloc=ON the default.

Replace srv_use_sys_malloc with UNIV_LIKELY(srv_use_sys_malloc)
to improve branch prediction in the default case.

Approved by Ken over the IM.
parent 8850a348
2009-02-20 The InnoDB Team
* handler/ha_innodb.cc:
Make innodb_use_sys_malloc=ON the default.
2009-02-20 The InnoDB Team
* handler/ha_innodb.cc, mysql-test/innodb-autoinc.result,
......
......@@ -9699,7 +9699,7 @@ static MYSQL_SYSVAR_STR(version, innodb_version_str,
static MYSQL_SYSVAR_BOOL(use_sys_malloc, srv_use_sys_malloc,
PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
"Use OS memory allocator instead of InnoDB's internal memory allocator",
NULL, NULL, FALSE);
NULL, NULL, TRUE);
static MYSQL_SYSVAR_STR(change_buffering, innobase_change_buffering,
PLUGIN_VAR_RQCMDARG,
......
......@@ -154,7 +154,7 @@ mem_init(
mem_hash_initialized = TRUE;
#endif
if (srv_use_sys_malloc) {
if (UNIV_LIKELY(srv_use_sys_malloc)) {
/* When innodb_use_sys_malloc is set, the
mem_comm_pool won't be used for any allocations. We
create a dummy mem_comm_pool, because some statistics
......
......@@ -353,7 +353,7 @@ mem_area_alloc(
/* If we are using os allocator just make a simple call
to malloc */
if (srv_use_sys_malloc) {
if (UNIV_LIKELY(srv_use_sys_malloc)) {
return(malloc(*psize));
}
......@@ -491,7 +491,7 @@ mem_area_free(
ulint size;
ulint n;
if (srv_use_sys_malloc) {
if (UNIV_LIKELY(srv_use_sys_malloc)) {
free(ptr);
return;
......
......@@ -161,7 +161,7 @@ collation */
UNIV_INTERN const byte* srv_latin1_ordering;
/* use os/external memory allocator */
UNIV_INTERN my_bool srv_use_sys_malloc = FALSE;
UNIV_INTERN my_bool srv_use_sys_malloc = TRUE;
/* requested size in kilobytes */
UNIV_INTERN ulint srv_buf_pool_size = ULINT_MAX;
/* previously requested size */
......
......@@ -1069,7 +1069,7 @@ innobase_start_or_create_for_mysql(void)
"InnoDB: !!!!!!!! UNIV_MEM_DEBUG switched on !!!!!!!!!\n");
#endif
if (srv_use_sys_malloc) {
if (UNIV_LIKELY(srv_use_sys_malloc)) {
fprintf(stderr,
"InnoDB: The InnoDB memory heap is disabled\n");
}
......
......@@ -92,7 +92,7 @@ ut_malloc_low(
ulint retry_count;
void* ret;
if (srv_use_sys_malloc) {
if (UNIV_LIKELY(srv_use_sys_malloc)) {
ret = malloc(n);
ut_a(ret || !assert_on_error);
......@@ -275,7 +275,7 @@ ut_free(
{
ut_mem_block_t* block;
if (srv_use_sys_malloc) {
if (UNIV_LIKELY(srv_use_sys_malloc)) {
free(ptr);
return;
}
......@@ -332,7 +332,7 @@ ut_realloc(
ulint min_size;
void* new_ptr;
if (srv_use_sys_malloc) {
if (UNIV_LIKELY(srv_use_sys_malloc)) {
return(realloc(ptr, size));
}
......
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