summaryrefslogtreecommitdiff
path: root/mysys/array.c
Commit message (Collapse)AuthorAgeFilesLines
* Updated/added copyright headersKent Boortz2011-06-301-2/+2
|\
| * Updated/added copyright headersKent Boortz2011-06-301-2/+5
| |\
| | * Updated/added copyright headersKent Boortz2011-06-301-2/+3
| | |
* | | Bug#34043: Server loops excessively in _checkchunk() when safemalloc is enabledDavi Arnaut2010-07-081-5/+4
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Fix for a few assorted compiler warnings.Davi Arnaut2009-08-281-1/+1
| |
* | merging with mysql-5.0-bugteamV Narayanan2009-07-171-7/+7
|\ \ | |/
| * Bug#43572 Handle failures from hash_initV Narayanan2009-07-121-6/+7
| | | | | | | | | | | | | | | | | | | | | | This patch is a follow up to http://lists.mysql.com/commits/76678. When an allocation failure occurs for the buffer in the dynamic array, an error condition was being set. The dynamic array is usable even if the memory allocation fails. Since in most cases the thread can continue to work without any problems the error condition should not be set here. This patch adds logic to remove the error condition from being set when the memory allocation for the buffer in dynamic array fails.
* | Bug#29125 Windows Server X64: so many compiler warningsIgnacio Galarza2009-02-131-1/+1
|\ \ | |/ | | | | | | | | - Remove bothersome warning messages. This change focuses on the warnings that are covered by the ignore file: support-files/compiler_warnings.supp. - Strings are guaranteed to be max uint in length
* | Moved a lot of old bug fixes and safe cleanups from Maria 5.1 tree to 5.1monty@mysql.com/narttu.mysql.fi2007-10-111-31/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Reserver namespace and place in frm for TABLE_CHECKSUM and PAGE_CHECKSUM create options - Added syncing of directory when creating .frm files - Portability fixes - Added missing cast that could cause bugs - Code cleanups - Made some bit functions inline - Moved things out of myisam.h to my_handler.h to make them more accessable - Renamed some myisam variables and defines to make them more globaly usable (as they are used outside of MyISAM) - Fixed bugs in error conditions - Use compiler time asserts instead of run time - Fixed indentation HA_EXTRA_PREPARE_FOR_DELETE -> HA_EXTRA_PREPARE_FOR_DROP as the old name was wrong (Added a define for old value to ensure we don't break any old code) Added HA_EXTRA_PREPARE_FOR_RENAME as a signal for rename (before we used a DROP signal which is wrong) - Initialize error messages early to get better errors when mysqld or an engine fails to start - Fix windows bug that query_performance_frequency was not initialized if registry code failed - thread_stack -> my_thread_stack_size
* | Added casts to avoid compiler warnings and fixed a wrong type.jani@a88-113-38-195.elisa-laajakaista.fi2007-05-311-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | --- Added casts and fixed wrong type. --- Added casts and fixed wrong type. --- Merge jamppa@bk-internal.mysql.com:/home/bk/mysql-5.1-marvel into a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-5.1-marvel --- Don't give warning that readonly variable is forced to be readonly mysql-test-run run now fails if we have [Warning] and [ERROR] as tags in .err file Fixed wrong reference to the mysql manual Fixed wrong prototype that caused some tests to fail on 64 bit platforms --- Disabled compiler warnings mainly for Win 64. --- Added casts to remove compiler warnings on windows Give warnings also for safe_mutex errors found by test system Added some warnings from different machines in pushbuild --- Merge bk-internal.mysql.com:/home/bk/mysql-5.1-marvel into mysql.com:/home/my/mysql-5.1 --- Added escapes for double quotes and parenthesis. --- Archive db fix plus added non-critical warnings in ignore list. --- Fixed previously added patch and added new ignored warning.
* | Changed accidently added tabs back into spaces.jani@a88-113-38-195.elisa-laajakaista.fi2007-05-281-22/+22
| | | | | | | | Fixed a bug that came in merge.
* | Merge jamppa@bk-internal.mysql.com:/home/bk/mysql-5.1jani@a88-113-38-195.elisa-laajakaista.fi2007-05-241-9/+9
|\ \ | | | | | | | | | into a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-5.1-marvel
| * | WL#3817: Simplify string / memory area types and make things more consistent ↵monty@mysql.com/narttu.mysql.fi2007-05-101-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (first part) The following type conversions was done: - Changed byte to uchar - Changed gptr to uchar* - Change my_string to char * - Change my_size_t to size_t - Change size_s to size_t Removed declaration of byte, gptr, my_string, my_size_t and size_s. Following function parameter changes was done: - All string functions in mysys/strings was changed to use size_t instead of uint for string lengths. - All read()/write() functions changed to use size_t (including vio). - All protocoll functions changed to use size_t instead of uint - Functions that used a pointer to a string length was changed to use size_t* - Changed malloc(), free() and related functions from using gptr to use void * as this requires fewer casts in the code and is more in line with how the standard functions work. - Added extra length argument to dirname_part() to return the length of the created string. - Changed (at least) following functions to take uchar* as argument: - db_dump() - my_net_write() - net_write_command() - net_store_data() - DBUG_DUMP() - decimal2bin() & bin2decimal() - Changed my_compress() and my_uncompress() to use size_t. Changed one argument to my_uncompress() from a pointer to a value as we only return one value (makes function easier to use). - Changed type of 'pack_data' argument to packfrm() to avoid casts. - Changed in readfrm() and writefrom(), ha_discover and handler::discover() the type for argument 'frmdata' to uchar** to avoid casts. - Changed most Field functions to use uchar* instead of char* (reduced a lot of casts). - Changed field->val_xxx(xxx, new_ptr) to take const pointers. Other changes: - Removed a lot of not needed casts - Added a few new cast required by other changes - Added some cast to my_multi_malloc() arguments for safety (as string lengths needs to be uint, not size_t). - Fixed all calls to hash-get-key functions to use size_t*. (Needed to be done explicitely as this conflict was often hided by casting the function to hash_get_key). - Changed some buffers to memory regions to uchar* to avoid casts. - Changed some string lengths from uint to size_t. - Changed field->ptr to be uchar* instead of char*. This allowed us to get rid of a lot of casts. - Some changes from true -> TRUE, false -> FALSE, unsigned char -> uchar - Include zlib.h in some files as we needed declaration of crc32() - Changed MY_FILE_ERROR to be (size_t) -1. - Changed many variables to hold the result of my_read() / my_write() to be size_t. This was needed to properly detect errors (which are returned as (size_t) -1). - Removed some very old VMS code - Changed packfrm()/unpackfrm() to not be depending on uint size (portability fix) - Removed windows specific code to restore cursor position as this causes slowdown on windows and we should not mix read() and pread() calls anyway as this is not thread safe. Updated function comment to reflect this. Changed function that depended on original behavior of my_pwrite() to itself restore the cursor position (one such case). - Added some missing checking of return value of malloc(). - Changed definition of MOD_PAD_CHAR_TO_FULL_LENGTH to avoid 'long' overflow. - Changed type of table_def::m_size from my_size_t to ulong to reflect that m_size is the number of elements in the array, not a string/memory length. - Moved THD::max_row_length() to table.cc (as it's not depending on THD). Inlined max_row_length_blob() into this function. - More function comments - Fixed some compiler warnings when compiled without partitions. - Removed setting of LEX_STRING() arguments in declaration (portability fix). - Some trivial indentation/variable name changes. - Some trivial code simplifications: - Replaced some calls to alloc_root + memcpy to use strmake_root()/strdup_root(). - Changed some calls from memdup() to strmake() (Safety fix) - Simpler loops in client-simple.c
* | | Merge bk-internal.mysql.com:/home/bk/mysql-5.1serg@sergbook.mysql.com2007-04-161-3/+59
|\ \ \ | |/ / |/| | | | | into sergbook.mysql.com:/usr/home/serg/Abk/mysql-5.1-wl2936
| * | WL#2936antony@ppcg5.local2007-03-231-1/+2
| | | | | | | | | | | | | | | "Server variables for plugins" Post review fixes.
| * | WL#2936antony@ppcg5.local2007-03-021-3/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | "Server Variables for Plugins" Implement support for plugins to declare server variables. Demonstrate functionality by removing InnoDB specific code from sql/* New feature for HASH - HASH_UNIQUE flag New feature for DYNAMIC_ARRAY - initializer accepts preallocated ptr. Completed support for plugin reference counting.
* | | Merge recycle.(none):/src/bug23736/my50-bug23736iggy@recycle.(none)2007-03-201-4/+0
|\ \ \ | |/ / |/| / | |/ into recycle.(none):/src/bug23736/my51-bug23736
| * Bug#23736 Pointer free error in mysqlbinlogiggy@recycle.(none)2007-03-201-4/+0
| | | | | | | | - Mis-matched SAFEMALLOC defines caused misleading error message.
* | Merge mysql.com:/home/kent/bk/main/mysql-5.0kent@kent-amd64.(none)2006-12-231-2/+1
|\ \ | |/ | | | | into mysql.com:/home/kent/bk/main/mysql-5.1
| * Many files:kent@mysql.com/kent-amd64.(none)2006-12-231-2/+1
| | | | | | | | Changed header to GPL version 2 only
* | WL1034 update for latest 5.1 sourcesandrey@lmy004.2005-12-021-0/+25
|/
* Rewrite function commentssalle@geopard.(none)2002-07-091-5/+108
|
* init_dynamic_array MyODBC compatibility fixserg@serg.mysql.com2002-04-281-1/+1
|
* support for unsigned FLOAT/DOUBLEmonty@hundin.mysql.fi2002-03-271-1/+2
|
* merged from 3.23 to pull the LOAD DATA INFILE fix as rpl000001 was failing.sasha@mysql.sashanet.com2002-03-011-4/+4
|\ | | | | | | | | Let's hope this did not break anything. Will not push this one until Monty gets back
| * Framework to simplify memory leak tracingserg@serg.mysql.com2002-01-221-4/+4
| |
* | Update copyrightmonty@hundin.mysql.fi2001-12-061-15/+14
|/ | | | Fixed memory leak on shutdown (Affects the embedded version & MyODBC)
* Import changesetbk@work.mysql.com2000-07-311-0/+177