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