History log of /PHP-8.0/Zend/zend_alloc.c (Results 1 – 25 of 453)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# c035298e 08-Feb-2022 Dmitry Stogov

Free cached chunks when the requested memory limit is above real usage


# 5675ebe6 09-Dec-2021 Christoph M. Becker

Fix #81585: cached_chunks are not counted to real_size on shutdown

The amount of allocated system memory is kept in `real_size`, including
the allocated `cached_chunks`. Thus, we need t

Fix #81585: cached_chunks are not counted to real_size on shutdown

The amount of allocated system memory is kept in `real_size`, including
the allocated `cached_chunks`. Thus, we need to keep the proper count
at the end of the shutdown.

Closes GH-7745.

show more ...


# 1b3b5c94 30-May-2021 Peter van Dommelen

Fixed bug #81070

When the memory limit is reduced using an `ini_set("memory_limit", ..)`
below the currently allocated memory, the out-of-memory check overflowed.
Instead of implemen

Fixed bug #81070

When the memory limit is reduced using an `ini_set("memory_limit", ..)`
below the currently allocated memory, the out-of-memory check overflowed.
Instead of implementing additional checks during allocation,
`zend_set_memory_limit()` now validates the new memory limit. When
below the current memory usage the ini_set call will fail and throw
a warning.

This is part of GH-7040.

show more ...


# 600402d9 07-Apr-2021 fishmore <37470985+bigboysun@users.noreply.github.com>

Update zend_alloc.c

Don't free main thunk. It will crash.


Revision tags: php-8.0.0, php-7.3.25, php-7.4.13, php-8.0.0RC5, php-7.4.13RC1, php-8.0.0RC4, php-7.3.25RC1, php-7.4.12, php-8.0.0RC3, php-7.3.24, php-8.0.0RC2, php-7.4.12RC1, php-7.3.24RC1, php-7.2.34, php-8.0.0rc1, php-7.4.11, php-7.3.23, php-8.0.0beta4, php-7.4.11RC1, php-7.3.23RC1, php-8.0.0beta3, php-7.4.10, php-7.3.22
# fa8d9b11 28-Aug-2020 George Peter Banyard

Improve type declarations for Zend APIs

Voidification of Zend API which always succeeded
Use bool argument types instead of int for boolean arguments
Use bool return type for functio

Improve type declarations for Zend APIs

Voidification of Zend API which always succeeded
Use bool argument types instead of int for boolean arguments
Use bool return type for functions which return true/false (1/0)
Use zend_result return type for functions which return SUCCESS/FAILURE as they don't follow normal boolean semantics

Closes GH-6002

show more ...


# 5db44e39 28-Aug-2020 Nikita Popov

Fix tracked_realloc

We should only drop the information about the old allocation after
checking the memory limit. This makes the code a bit more awkward...


# bd6feb7b 26-Aug-2020 Nikita Popov

Enforce memory limit in tracked allocation mode

A very basic limit (for single allocations) was already enforced.
This extends it to count the total memory allocations.

This is

Enforce memory limit in tracked allocation mode

A very basic limit (for single allocations) was already enforced.
This extends it to count the total memory allocations.

This is useful to avoid out of memory conditions while fuzzing.

show more ...


Revision tags: php-8.0.0beta2, php-7.3.22RC1, php-7.4.10RC1, php-8.0.0beta1, php-7.4.9, php-7.2.33, php-7.3.21
# 7d4ae7fa 01-Aug-2020 tangl163

Drop the unneeded pointer casting

The standard says that "A pointer to void may be converted to or from a
pointer to any object type". So the casting is unneeded.

REF:
*

Drop the unneeded pointer casting

The standard says that "A pointer to void may be converted to or from a
pointer to any object type". So the casting is unneeded.

REF:
* c11: http://port70.net/~nsz/c/c11/n1570.html#6.3.2.3p1
* c99: http://port70.net/~nsz/c/c99/n1256.html

Closes GH-5916

show more ...


Revision tags: php-8.0.0alpha3, php-7.4.9RC1, php-7.3.21RC1, php-7.4.8, php-7.2.32, php-8.0.0alpha2, php-7.3.20, php-8.0.0alpha1, php-7.4.8RC1, php-7.3.20RC1, php-7.4.7, php-7.3.19, php-7.4.7RC1, php-7.3.19RC1, php-7.4.6, php-7.2.31, php-7.4.6RC1, php-7.3.18RC1, php-7.2.30, php-7.4.5, php-7.3.17, php-7.4.5RC1, php-7.3.17RC1, php-7.3.18, php-7.4.4, php-7.2.29, php-7.3.16, php-7.4.4RC1, php-7.3.16RC1, php-7.4.3, php-7.2.28, php-7.3.15RC1, php-7.4.3RC1
# 370c00e9 28-Jan-2020 Nikita Popov

Add crude memory limit to tracked alloc

Check whether the requested allocation size exceeds limit (rather
than the cumulative size).

This is useful to prevent allocations trigge

Add crude memory limit to tracked alloc

Check whether the requested allocation size exceeds limit (rather
than the cumulative size).

This is useful to prevent allocations triggering OOM during fuzzing.

show more ...


# 45b4368d 27-Feb-2020 Dmitry Stogov

Fixed incorrect behavior of internal memory debugger


Revision tags: php-7.3.15, php-7.2.27, php-7.4.2, php-7.3.14, php-7.3.14RC1, php-7.4.2RC1, php-7.4.1, php-7.2.26, php-7.3.13, php-7.4.1RC1, php-7.3.13RC1, php-7.2.26RC1, php-7.4.0, php-7.2.25, php-7.3.12, php-7.4.0RC6, php-7.3.12RC1, php-7.2.25RC1, php-7.4.0RC5
# 9d48bf51 27-Oct-2019 Tyson Andre

Fix miscellaneous typos in docs and error messages

Closes GH-4863.


# af57b633 23-Oct-2019 Rasmus Lerdorf

Reverting push to wrong repo


# 5870efbc 23-Oct-2019 Rasmus Lerdorf

Update alloc patch


Revision tags: php-7.1.33, php-7.2.24, php-7.3.11, php-7.4.0RC4, php-7.3.11RC1, php-7.2.24RC1
# abaf9a76 03-Oct-2019 Christoph M. Becker

Fix #78620: Out of memory error

The integer addition in `ZEND_MM_ALIGNED_SIZE_EX` can overflow, what we
have to catch early.


# f2fb37a7 02-Oct-2019 Christoph M. Becker

Revert "Fix #78620: Out of memory error"

This reverts commit 8ce04df7e0108a10f7b782a28204e9384ab1129c.

Cf. <https://github.com/php/php-src/pull/4766#discussion_r330658679>.


# 8ce04df7 02-Oct-2019 Christoph M. Becker

Fix #78620: Out of memory error

If the integer addition in `ZEND_MM_ALIGNED_SIZE_EX` overflows, the
macro evaluates to `0`, what we should catch early.


Revision tags: php-7.4.0RC3, php-7.2.23, php-7.3.10, php-7.4.0RC2, php-7.2.23RC1, php-7.3.10RC1, php-7.4.0RC1, php-7.1.32, php-7.2.22, php-7.3.9, php-7.4.0beta4, php-7.2.22RC1, php-7.3.9RC1, php-7.4.0beta2, php-7.1.31, php-7.2.21, php-7.3.8
# ce25fa0d 27-Jul-2019 David Carlier

Monitoring anonymous pages on mac via vmmap tag


# 16d35eb6 26-Aug-2019 Nikita Popov

Fix overflow in memory limit checks

Due to overflows in the memory limit checks, we were missing cases
where the allocation size was close to the address space size, and
caused an OO

Fix overflow in memory limit checks

Due to overflows in the memory limit checks, we were missing cases
where the allocation size was close to the address space size, and
caused an OOM condition rather than a memory limit error.

show more ...


Revision tags: php-7.4.0beta1, php-7.2.21RC1, php-7.3.8RC1, php-7.4.0alpha3, php-7.3.7, php-7.2.20
# 70fa4715 28-Jun-2019 Nikita Popov

Fix custom heap free

This seems to be designed around the use-case where the custom
allocator is a wrapper around ZMM.


# cfeda978 27-Jun-2019 Nikita Popov

Add tracked allocator mode

In this case we will use the system allocator, but still remember
all allocations and free them the same way that Zend MM does. This
allows us to accuratel

Add tracked allocator mode

In this case we will use the system allocator, but still remember
all allocations and free them the same way that Zend MM does. This
allows us to accurately model leak behavior.

Enabled using USE_ZEND_ALLOC=0 USE_TRACKED_ALLOC=1.

show more ...


Revision tags: php-7.4.0alpha2, php-7.3.7RC3
# 3d429869 19-Jun-2019 Nikita Popov

Fix shift UB in constants

We were shifting out the top bit of a signed integer.


Revision tags: php-7.3.7RC2, php-7.2.20RC2, php-7.4.0alpha1, php-7.3.7RC1, php-7.2.20RC1, php-7.2.19
# 08a0030b 29-May-2019 Anatol Belski

Fix conditional compilation

The new symbols are shared and don't need to depend on the availability
of __builtin_constant_p.


# 8c0b0c6a 28-May-2019 Dmitry Stogov

Avoid cold code duplication


Revision tags: php-7.3.6, php-7.1.30, php-7.2.19RC1, php-7.3.6RC1
# 3c92b79e 07-May-2019 Peter Kokot

Remove unused functions

- zend_mm_bitset_find_zero
- zend_mm_bitset_find_one
- zend_mm_bitset_find_zero_and_set
- zend_is_by_ref_func_arg_fetch


Revision tags: php-7.1.29, php-7.2.18, php-7.3.5, php-7.2.18RC1, php-7.3.5RC1
# 5f891578 07-Apr-2019 Peter Kokot

Remove HAVE_SIGNAL_H

The `<signal.h>` header file is part of the standard C89 headers [1] and
on current systems can be included unconditionally.

Since file requires at least C8

Remove HAVE_SIGNAL_H

The `<signal.h>` header file is part of the standard C89 headers [1] and
on current systems can be included unconditionally.

Since file requires at least C89 or greater, the `HAVE_SIGNAL_H` symbol
defined by Autoconf in Zend.m4 [2] can be ommitted and simplifed.

The bundled libmagic (file) also ommits the usage of HAVE_SIGNAL_H since
5.35 however current version in PHP is very modified 5.34 version and
will be refactored separately. Check for HAVE_SIGNAL_H is therefore
still done in the configure.ac.

Refs:
[1] https://port70.net/~nsz/c/c89/c89-draft.html#4.1.2
[2] https://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4

show more ...


12345678910>>...19