mirror of
https://github.com/MariaDB/server.git
synced 2025-01-20 05:52:27 +01:00
f56dd32bf7
Essentially, the problem is that safemalloc is excruciatingly slow as it checks all allocated blocks for overrun at each memory management primitive, yielding a almost exponential slowdown for the memory management functions (malloc, realloc, free). The overrun check basically consists of verifying some bytes of a block for certain magic keys, which catches some simple forms of overrun. Another minor problem is violation of aliasing rules and that its own internal list of blocks is prone to corruption. Another issue with safemalloc is rather the maintenance cost as the tool has a significant impact on the server code. Given the magnitude of memory debuggers available nowadays, especially those that are provided with the platform malloc implementation, maintenance of a in-house and largely obsolete memory debugger becomes a burden that is not worth the effort due to its slowness and lack of support for detecting more common forms of heap corruption. Since there are third-party tools that can provide the same functionality at a lower or comparable performance cost, the solution is to simply remove safemalloc. Third-party tools can provide the same functionality at a lower or comparable performance cost. The removal of safemalloc also allows a simplification of the malloc wrappers, removing quite a bit of kludge: redefinition of my_malloc, my_free and the removal of the unused second argument of my_free. Since free() always check whether the supplied pointer is null, redudant checks are also removed. Also, this patch adds unit testing for my_malloc and moves my_realloc implementation into the same file as the other memory allocation primitives. client/mysqldump.c: Pass my_free directly as its signature is compatible with the callback type -- which wasn't the case for free_table_ent.
45 lines
1.6 KiB
PHP
45 lines
1.6 KiB
PHP
#
|
|
# mysqld --help
|
|
#
|
|
--source include/not_embedded.inc
|
|
|
|
#
|
|
# force lower-case-table-names=1 (linux/macosx have different defaults)
|
|
# force symbolic-links=0 (valgrind build has a different default)
|
|
#
|
|
exec $MYSQLD_BOOTSTRAP_CMD --symbolic-links=0 --lower-case-table-names=1 --help --verbose > $MYSQL_TMP_DIR/mysqld--help.txt 2>&1;
|
|
|
|
perl;
|
|
@skipvars=qw/basedir open-files-limit general-log-file log plugin-dir
|
|
log-slow-queries pid-file slow-query-log-file
|
|
datadir slave-load-tmpdir tmpdir/;
|
|
@plugins=qw/innodb ndb archive blackhole federated partition ndbcluster debug temp-pool ssl des-key-file
|
|
thread-concurrency super-large-pages mutex-deadlock-detector null-audit/;
|
|
@env=qw/MYSQLTEST_VARDIR MYSQL_TEST_DIR MYSQL_LIBDIR MYSQL_CHARSETSDIR MYSQL_SHAREDIR /;
|
|
$re1=join('|', @skipvars, @plugins);
|
|
$re2=join('|', @plugins);
|
|
$skip=0;
|
|
open(F, '<', "$ENV{MYSQL_TMP_DIR}/mysqld--help.txt") or die;
|
|
while (<F>) {
|
|
next if 1../The following groups are read/;
|
|
# formatting, skip line consisting entirely of dashes and blanks
|
|
next if /^[\- ]+\s?$/;
|
|
next if /Value \(after reading options\)/; # skip table header
|
|
next if /^($re1) /;
|
|
next if /^($re2)-/;
|
|
$skip=0 if /^ -/;
|
|
$skip=1 if / --($re2)\b/;
|
|
y!\\!/!;
|
|
s/[ ]+/ /; # squeeze spaces to remove table formatting
|
|
# fixes for 32-bit
|
|
s/\b4294967295\b/18446744073709551615/;
|
|
s/\b2146435072\b/9223372036853727232/;
|
|
s/\b196608\b/262144/;
|
|
foreach $var (@env) { s/$ENV{$var}/$var/ }
|
|
next if /use --skip-(use-)?symbolic-links to disable/; # for valgrind, again
|
|
next if $skip;
|
|
print;
|
|
}
|
|
close F;
|
|
EOF
|
|
|