Commit Graph

127 Commits

Author SHA1 Message Date
Dmitry Stogov
d514bf27a6 Improved Zend Memory Manager to guarantee reasonable time for worst cases of best-fit free block searching algorithm. 2007-03-20 06:46:48 +00:00
Antony Dovgal
e5b5f00949 MFH: fix #40800 (cannot disable memory_limit with -1) 2007-03-14 11:58:05 +00:00
Ilia Alshanetsky
0638ac7651 Fixed calloc wrapper 2007-03-07 00:55:49 +00:00
Ilia Alshanetsky
f6343f45f2 Add checks around raw allocation code 2007-03-07 00:47:42 +00:00
Stanislav Malyshev
624dd135a8 fix typo 2007-02-16 18:10:36 +00:00
Stanislav Malyshev
4274449a02 add safe_realloc 2007-02-16 18:06:28 +00:00
Sebastian Bergmann
4223aa4d5e MFH: Bump year. 2007-01-01 09:36:18 +00:00
Dmitry Stogov
e6fd66facb Make zend_memory_peak_usage() to be avalable even without --enable-memory-limit 2006-10-12 06:46:51 +00:00
Dmitry Stogov
ff3dfa94dd Allow future extensibility without binary compatibility break 2006-10-05 08:08:57 +00:00
Dmitry Stogov
27c327b97e Added is_zend_mm() to allow runtime check for zend memory manager 2006-09-14 08:00:44 +00:00
Dmitry Stogov
356facf4af Changed memory_get_usage() and memory_get_peak_usage(). Optional boolean argument allows get memory size allocated by emalloc() (by default) or real size of memory allocated from system. 2006-07-25 13:40:05 +00:00
Dmitry Stogov
29ed52ffa4 New memory manager 2006-07-18 09:06:33 +00:00
Andi Gutmans
61e93ccfe8 - Update copyright notices to 2006 2006-01-04 23:53:05 +00:00
Antony Dovgal
dfcc155c76 fix compile warning with Apache2 and Zend VM disabled
(someone forgot to do MFH)
2005-12-16 22:29:34 +00:00
foobar
916815b779 Bump up the year 2005-08-03 13:30:58 +00:00
Derick Rethans
7a3dbcd1c4 - Added the --disable-zend-memory-manager switch to disable the Zend memory
manager.
#- I discussed this with Dmitry today - we found it useful.
2005-06-07 13:36:08 +00:00
foobar
355eefe5f9 - Nuke the code duplication 2005-04-07 20:15:21 +00:00
foobar
9356d7fc64 Fix build when USE_ZEND_ALLOC is 0 2005-04-07 16:22:15 +00:00
Zeev Suraski
779f5c5c19 Fix strdup() bug when USE_ZEND_ALLOC is disabled 2005-04-07 13:59:45 +00:00
Derick Rethans
4894978500 - Added missing defines.
#- I did say the patch was for 4.3 ;-)
2004-08-11 06:11:07 +00:00
Andi Gutmans
f3d6620f00 - Commit Derick's patch for allowing Zend to use regular libc memory
- allocation functions. Mainly useful in conjunction with tools such as
- valgrind which enables us to find bugs we might not find with the
- current memory managers boundary protection.
2004-08-07 00:45:34 +00:00
Andi Gutmans
138ef9a43e - Improve performance by inlining zend_ptr_stack_n_push(). var_args can
usually not be inlined by compilers.
2004-07-30 20:16:40 +00:00
Moriyoshi Koizumi
182e93ab6e - Add safe_pemalloc() 2004-07-20 21:55:57 +00:00
Andi Gutmans
56f8195fe5 - Nuke empty_string. It is a reminanent from the time where RETURN_FALSE()
used to return "" and not bool(false). It's not worth keeping it because
  STR_FREE() and zval_dtor() always have to check for it and it slows down
  the general case. In addition, it seems that empty_string has been abused
  quite a lot, and was used not only for setting zval's but generally in
  PHP code instead of "", which wasn't the intention. Last but not least,
  nuking empty_string should improve stability as I doubt every place
  correctly checked if they are not mistakenly erealloc()'ing it or
  calling efree() on it.
  NOTE: Some code is probably broken. Each extension maintainer should
  check and see that my changes are OK. Also, I haven't had time to touch
  PECL yet. Will try and do it tomorrow.
2004-07-19 07:19:50 +00:00
Andi Gutmans
eb2e53be99 - Improve performance of zend_alloc by stopping the size from being a bit
- field.
2004-07-15 22:59:54 +00:00
Andi Gutmans
02884a08f5 - More fixes 2004-05-25 10:09:46 +00:00
Andi Gutmans
6704ab4b35 - Make fix compile. 2004-05-25 09:25:22 +00:00
Andi Gutmans
db90fc4c90 - Fix memory leak in mem cache in conjunction with Zend MM. How come no one
- noticed this? :)
2004-05-25 08:33:11 +00:00
foobar
ccfc46b0aa - Happy new year and PHP 5 for rest of the files too..
# Should the LICENSE and Zend/LICENSE dates be updated too?
2004-01-08 17:33:29 +00:00
Sascha Schumann
169d43e5fa cleanup & centralize ZEND_GCC_VERSION and ZEND_ATTRIBUTE_MALLOC so that
they can be used by downstream applications
2003-08-28 14:53:02 +00:00
Sascha Schumann
f065aba3ba Enable attribute((malloc)) for GCC 2.96 2003-08-28 11:55:39 +00:00
Sascha Schumann
6d7e56a0c8 GCC 2 does not know about malloc yet. 2003-08-28 06:17:05 +00:00
Sascha Schumann
cf1f6e3c4c provide attribute((malloc)) where appropiate 2003-08-28 05:50:15 +00:00
Zeev Suraski
0dba58c373 Improve tracking 2003-08-18 21:17:26 +00:00
James Cox
f68c7ff249 updating license information in the headers. 2003-06-10 20:04:29 +00:00
Sascha Schumann
04d2905fb5 add safe_emalloc 2003-04-24 03:35:06 +00:00
foobar
333406bdc2 - Added some missing CVS $Id$ tags, headers and footers. 2003-02-01 01:49:15 +00:00
Sebastian Bergmann
2c5d4b8c23 Bump year. 2002-12-31 15:59:15 +00:00
Andi Gutmans
1c20bf27da - Don't keep allocated blocks in a linked list if we're in non-debug mode
- as now the memory manager takes care to nuke all leaking blocks.
2002-06-24 07:22:25 +00:00
Andi Gutmans
e2f57d0fcc - MFZE1 2002-06-22 14:37:49 +00:00
Andi Gutmans
b53569c9e8 - Nuke persist_alloc(). 2002-06-22 13:52:07 +00:00
Sebastian Bergmann
8463225b49 Revert. 2002-04-28 06:24:15 +00:00
Sebastian Bergmann
90bad130a9 MFZE1: If the size-operands of memset are constants, the compiler can turn them into fast inline code. So, instead of using ecalloc, we use emalloc + memset in macro form now. emalloc will not return NULL, so the chosen macro form is safe. This is not true for malloc(3). An inline function accomodates our needs here. Suggested by: http://www.mail-archive.com/dev%40httpd.apache.org/msg02492.html (Sascha) 2002-04-27 15:23:46 +00:00
Andi Gutmans
7df1601239 - MFZE1 2002-02-26 19:17:26 +00:00
Sebastian Bergmann
62dc854bb0 Happy New Year. 2002-01-06 15:21:36 +00:00
Sebastian Bergmann
d863d52a5d Update headers. 2001-12-11 15:16:21 +00:00
Zeev Suraski
4f6c95d17a Whitespace 2001-08-11 15:56:40 +00:00
Zeev Suraski
b4f3b9d3ce Redesigned thread safety mechanism - nua nua 2001-07-28 10:51:54 +00:00
Andi Gutmans
b63bcebc6e - Whitespace 2001-04-29 13:06:00 +00:00
Andi Gutmans
277ab5f223 - Improve overwrite detection in debug mode. 2001-04-29 13:00:46 +00:00
Andi Gutmans
d2c9e8074c - Update copyright year 2001-02-26 05:43:27 +00:00
Zeev Suraski
769cde2f9f Fix Zend build for non ZTS 2000-11-19 12:28:28 +00:00
Zeev Suraski
9a0b61a619 Add thread-safety debugging information (idea - Dmitri Dmitrienko) 2000-11-18 02:43:23 +00:00
Zeev Suraski
ab3beffad7 The new INI parser is showing some signs of life 2000-10-29 22:40:01 +00:00
Sascha Schumann
a61721741b Replace macros which begin with an underscore through an appropiately
named macro.
2000-07-03 00:55:36 +00:00
Andi Gutmans
93e9520314 - Change cache size and only initialize part of it. 2000-06-22 18:33:09 +00:00
Andi Gutmans
988435cf04 - More correct way of doing bit mask 2000-06-14 19:10:30 +00:00
Andi Gutmans
9fb095b50e - Allocate and cache in 8 byte blocks. Most allocators anyway use 8 byte
- blocks. This should help fragmentation and cache hits.
- The old tree is tagged as PRE_EIGHT_BYTE_ALLOC_PATCH
2000-06-09 15:54:14 +00:00
Andi Gutmans
2572b088d0 *** empty log message *** 2000-03-25 19:23:16 +00:00
Zeev Suraski
5e55e47f7f It's official now... 2000-03-06 05:26:39 +00:00
Zeev Suraski
0ac9536d99 (c) patch 2000-02-19 22:46:42 +00:00
Andi Gutmans
0296bba808 - Run it on align_test 2000-01-30 04:49:43 +00:00
Andi Gutmans
b862a8b728 - This will save some memory w/ GCC compilers on some platforms 2000-01-29 09:14:22 +00:00
Zeev Suraski
c517633b49 namespace protection 1999-12-26 20:45:42 +00:00
Stig S. Bakken
93536507f6 Fix warnings surfacing in maintainer-mode. 1999-12-01 22:55:20 +00:00
Andi Gutmans
99947a251e - Shift around header files. 1999-09-05 19:03:35 +00:00
Zeev Suraski
cda27ae9ac Beef up debug macros 1999-08-28 10:18:54 +00:00
Zeev Suraski
aa8b27ba1d Better debug macros 1999-08-27 19:17:19 +00:00
Zeev Suraski
8d1de13aef 0.91 update 1999-07-19 20:02:12 +00:00
Zeev Suraski
b5b1117760 License update 1999-07-16 14:58:16 +00:00
Zeev Suraski
6abe9c34d9 * Support recoverable failure from erealloc()
* Fix the shutdown code on an unrecoverable erealloc() failure
1999-07-09 11:03:56 +00:00
Zeev Suraski
98b6ddda90 * Make the memory leak reporting code much better with repeats
* Remove useless variables
1999-06-26 11:48:22 +00:00
Zeev Suraski
1250c43a39 * Add struct name to all typedef's so that they can be debugged with MSVC
* Fix an AiCount bug - list(...) = $var was using $var multiple times, and thus
causing AiCount to be decreased multiple times even though it was increased only
once for $var.  Mark all FETCH_DIM's so that they won't decrease AiCount, and only
decrease AiCount on the last FETCH_DIM.
* Fix a stupid bug - forgot to pass CLS_C to some compiler function.  For some reason
MSVC doesn't report these :I
1999-05-22 16:10:51 +00:00
Zeev Suraski
1aa2c5c0b4 Ok, call me crazy, because I probably am.
Thread safe version now uses a C++ scanner object.  Works fully.
1999-04-23 03:32:33 +00:00
Zeev Suraski
4472d05025 Allow runtime setting of the memory limit 1999-04-10 16:24:28 +00:00
Zeev Suraski
2e9886de3c Get rid of php3_ini in Zend 1999-04-10 14:44:35 +00:00
Andi Gutmans
573b46022c Zend Library 1999-04-07 18:10:10 +00:00