summaryrefslogtreecommitdiff
path: root/src/common/malloc.c
AgeCommit message (Collapse)AuthorFilesLines
2013-12-18Fixed Bug 7906shennetsind1-1/+1
http://hercules.ws/board/tracker/issue-7906-compiling-error-latest/ Signed-off-by: shennetsind <ind@henn.et>
2013-12-17Speed up of several procedures that rely on ERS, _mreallocz ('z'ero)shennetsind1-0/+33
Made Possible Thanks to the Woonderful Haruna! <3 Commit also fixes an inconsistency in the ERS, where it'd start with clear memory but would use garbage upon resizing, also implements a new ERS option that clears entries as soon as pass by ers_free, so that they'll be all shinny for when ers_alloc reuses them. Signed-off-by: shennetsind <ind@henn.et>
2013-12-17Fixed several compiler warningsHaru1-1/+1
- Warnings detected thanks to Xcode's compiler settings (more strict by default) and clang, warnings mostly but not only related to data sizes on 64 bit systems, that were silenced until now by very lax compiler settings. - This also decreases by a great deal the amount of warnings produced by MSVC in x64 mode (for the adventurous ones who tried that) - Also fixed (or silenced in case of false positives) the potential issues pointed out by the (awesome) clang static analyzer. - Patch co-produced with Ind, I'm merging and committing in his place! Signed-off-by: Haru <haru@dotalux.com>
2013-11-19Sanitized and improved several macros through the codeHaru1-31/+33
- Sanitized all potentially unsafe macros (related eA:15259) - Improved some function-like macros to evaluate their argument only once and keep it in a temporary variable. This improves performance in the damage calculation related code. Signed-off-by: Haru <haru@dotalux.com>
2013-08-08HPM Updateshennetsind1-1/+6
- Custom Packet Support - Custom Data Struct Support (currently append-able to map_session_data and socket_data) - Char Server Support - Login Server Support http://hercules.ws/board/topic/1934-hercules-plugin-manager-update/ Documentation will soon be updated in http://hercules.ws/wiki/HPM Signed-off-by: shennetsind <ind@henn.et>
2013-06-07Hercules Renewal Phase One : pc, party, map, timerSusu1-22/+22
Added iPc, iParty, iMap, iTimer to HPM exported interfaces
2013-05-30Memory Slasher - May 30 Patchshennetsind1-3/+3
http://hercules.ws/board/topic/928-memory-slasher-may-30-patch/ Signed-off-by: shennetsind <ind@henn.et>
2013-05-30Memory Slasher - May 30 Patchshennetsind1-10/+92
http://hercules.ws/board/topic/928-memory-slasher-may-30-patch/ Signed-off-by: shennetsind <ind@henn.et>
2013-05-18Some type conversion warnings fixed. If this breaks anything create a bug ↵Matheus Macabu1-3/+3
report ASAP and I will revert it gladly. Signed-off-by: Matheus Macabu <mkbu95@gmail.com>
2013-05-17Travis Fix Attempt #1shennetsind1-2/+2
Signed-off-by: shennetsind <ind@henn.et>
2013-05-17- Made DB and malloc lib HPM-friendlySusu1-27/+52
- Also fixed a bug preventing the plugins to be loeaded because HPMI and HPMI_s weren't HPExport
2013-04-16Partial Fix for #3110shennetsind1-46/+46
Translated mallo.c from japanese to english (yes with google so some stuff still sound iffy) http://hercules.ws/board/tracker/issue-3110-source-korean-comments/ Signed-off-by: shennetsind <ind@henn.et>
2013-03-30Modified memory manager logshennetsind1-6/+9
Now supporting hybrid tracking, git and/or svn revision Signed-off-by: shennetsind <ind@henn.et>
2012-12-05- Undid r16968: SVN Replaced with source:/trunk/src/@16966 (tid:74924).brianluau1-498/+508
[16969:16991/trunk/src/] will be re-committed in the next 24 hours. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16992 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-11-25Applied AStyle code formating as discussed on tid:74602.greenboxal21-508/+498
Removed /SAFESEH option from MSVC11 projects. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16968 54d463be-8e91-2dee-dedb-b68131a5f0ec
2012-07-12Fixed all warnings left from when compiling with -pedantic, confirmed with ↵shennetsind1-1/+1
gcc, llvm and clang. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16415 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-07-20* Made GCOLLECT use it's debug functions.flaviojs1-27/+39
* Turned off garbage collection for GCOLLECT since there's nothing to do with explicit frees. * Added malloc_verify_ptr/malloc_usage code for all memory libraries. * Added malloc_memory_check for debug purposes, tests memory for errors and memory leaks. * Added explicit memory check on malloc_final. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14917 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-07-20Removed malloc's Atomic (-A) function macros (see r968, changelog 01/20). ↵ultramage1-44/+1
They were specific to the GC allocator (atomic = promise to not have any pointers to other things inside = will be skipped during Mark phase), serving as a (dubious) optimization trick - which could cause GC to malfunction if used incorrectly. Simplified GC's CALLOC, since the GC docs say GC_MALLOC automatically clears memory. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14916 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-07-19* Made NO_MEMMGR only be set as a default value, allowing for simultaneous ↵flaviojs1-7/+69
use with the memory libraries. * Moved memory library selection to malloc.c to avoid poisoning the namespace of the rest of the code. * Removed BCHECK code since it's unneeded. (bcheck is an external batch tool that runs on top of the dbx debugger) * Fixed GCOLLECT usage. (missing init and final memory leak check) * Fixed DMALLOC usage. (missing options on CYGWIN and verify memory) * Renamed malloc_verify to malloc_verify_ptr to avoid conflict with DMALLOC. * Changed itemtype from inline to static inline to avoid error with the SunOS compiler. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14913 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-06-30Replaced custom type 'intptr' with standard 'intptr_t'.ultramage1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14873 54d463be-8e91-2dee-dedb-b68131a5f0ec
2011-06-26* Fixed a signed literal being assigned to an unsigned variable and other ↵ai4rei1-6/+2
minor cleanups in malloc (bugreport:4765). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14869 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-12-07* Reverted r14563, due to multiple issues which render the source ↵ai4rei1-3/+3
malfunctioning or uncompilable. To be redone later (bugreport:4627). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14567 54d463be-8e91-2dee-dedb-b68131a5f0ec
2010-12-07Changed almost all instances of sprintf() to snprintf().Paradox924X1-3/+3
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14563 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-11-22* Hunted down the simpler 64bit pointer truncations.FlavioJS1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13380 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-04-27Corrected r12662 where a guild break would trigger the OnGuildBreak event ↵ultramage1-2/+2
for all castles (even of other guilds). Corrected some x64 compilation warnings in ers/malloc files. cleaned up a case of bad variable reuse. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12666 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-02-19* Forgotten update to the definition of script command 'input'.FlavioJS1-0/+2
* Enabled DEBUG_MEMMGR only in DEBUG mode. * Made autotrading characters be kicked instead of reporting double login. * Made create_session initialize session_data to NULL. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12218 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-02-13* Changes to memory manager: [FlavioJS]FlavioJS1-31/+83
- fixed blocks that are fully used not being detected (and not freed) in memmgr_final (unfill_prev is NULL for unused blocks and full blocks) - fixed memmgr_final giving the wrong address to _mfree (for small blocks) - added the pointer address to most error messages (and log) - made it append to the log file instead of rewriting it - implemented a function to verify if a memory location is active - other minor changes git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12200 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-02-13Merged memory manager updates from old jA revisions (bugreport:663)ultramage1-305/+225
Produces less memory overhead and has better overflow detection. Caution, experimental / not fully tested code! (seems to work though...) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12198 54d463be-8e91-2dee-dedb-b68131a5f0ec
2008-01-06Modified showmsg code to not attach a timestamp to MSG_NONE-type messages, ↵ultramage1-1/+1
generated by ShowMessage(). It now works exactly like printf(). Removed/replaced all printf calls in the code. Added a new flag to setting 'console_silent', for filtering debug messages. Silenced the "Broken pipe found" and "Server running in debug mode" messages. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12020 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-12-30* Trully fixed the previous commits. (missing casts and incomplete sizes)FlavioJS1-4/+4
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11996 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-12-30Fixed a mistake of the previous commit (r11994). Was reading the size in the ↵FlavioJS1-1/+1
wrong place. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11995 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-12-30* Made the memory manager set allocated memory to 0xCD and freed memory to ↵FlavioJS1-0/+18
0xDD. The memory manager no longer 'hides' uses of freed memory. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11994 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-11-19* Nullpo's disabled on release builds.FlavioJS1-7/+15
* Added timestamps to the log of memory leaks. * Moved definition of __func__ to cbasetypes.h. * Configure script updated: - added option to select the memory manager - added option to enable MAPREGSQL - added option to enable DEBUG * common's Makefile deleting svnversion.h on 'clean' target. (run ./configure again to update your Makefile) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11760 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-10-17Using predefined constants as parameters to the exit() function.ultramage1-10/+10
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11501 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-07-01* TXT->SQL converter fixupultramage1-1/+1
- Added missing char_id insert which totally messed up the conversion - Fixed login converter ignoring many columns (although it had the data) - Pointed out that Login-stored account variable conversion is MISSING! - Pointed out that Status, Homunculus and Mapreg conversion is MISSING! - Blocked the config functions from exiting server when file not found - Finally added VS8 project files for this thing git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10835 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-05-19Reformatting @_@ultramage1-8/+16
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10581 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-04-09- Fixed some compiling warnings.skotlex1-4/+4
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10196 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-01-08Unimportant cleanupsultramage1-0/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9633 54d463be-8e91-2dee-dedb-b68131a5f0ec
2007-01-07Undid the memset->malloc_set replacementultramage1-54/+3
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9626 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-12-05- Massive EOL normalization & 'svn:eol-style native' flag setting for all ↵FlavioJS1-733/+733
txt/conf/h/c files. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9410 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-11-28- Changed write to send as suggested by TheUltraMage in:FlavioJS1-66/+34
http://www.eathena.ws/board/index.php?showtopic=105417 Hopefully that will take care of the SIGPIPE problem in Debian and cygwin. - Server name in core.c skipping '\\' characters. - Memory allocation functions using file,line,func from the invoking functions. - Other minor changes in malloc git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9344 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-08-28- The memory leak reports will now print out in the logs also the revision ↵skotlex1-1/+1
they belong to. - Cleaned up the scriptable npc-shop code, it should be crash-proof now. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8525 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-08-27And a minor typo. Sorry.Lance1-1/+1
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8506 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-08-27Tweaked MEMSET_TURBO abit, temperory disabled GCC version.Lance1-57/+29
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8505 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-08-27* Optional macro MEMSET_TURBO for faster low-level memory initializations.Lance1-4/+82
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8499 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-06-08- Modified map_freeblock_unlock so that aFree errors will report the ↵skotlex1-1/+1
file/line that INVOKED the function rather than the function itself. NOTE: Do NOT disable the memory manager as that will break this change. This change is to be temporarily set until it can be resolved. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7049 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-04-18- Changed the memory manager fatal errors when allocating memory to print ↵skotlex1-2/+2
out the size request as well as the file and line where they originated. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6165 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-01-29AS OF SVN REV. 5901, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES ↵Valaris1-0/+715
GO INTO TRUNK. IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. EVERYTHING ELSE GOES INTO TRUNK AND WILL BE MERGED INTO STABLE BY VALARIS AND WIZPUTER. -- VALARIS git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5094 54d463be-8e91-2dee-dedb-b68131a5f0ec
2006-01-29Clearing trunk.Valaris1-548/+0
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5091 54d463be-8e91-2dee-dedb-b68131a5f0ec
2005-04-07some small USE_MEMMGR changescelest1-12/+13
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1428 54d463be-8e91-2dee-dedb-b68131a5f0ec