History log of /php-src/Zend/zend_alloc.c (Results 1 – 25 of 521)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 07337df1 23-Apr-2024 Julien Voisin

Add two checks for zend_mm_heap's integrity (#13943)


# 7a3516cc 03-Apr-2024 David CARLIER

zend_alloc trailing 1 calculation helper ZEND_ATTRIBUTE_CONST addition. (#13874)


# 14873dd2 26-Feb-2024 Florian Engelhardt

Drop zend_mm_set_custom_debug_handlers() (#13457)

Simplifies zend_mm_set_custom_debug_handlers to just use zend_mm_set_custom_handlers(), saving some conditionals when the Zend allocator is

Drop zend_mm_set_custom_debug_handlers() (#13457)

Simplifies zend_mm_set_custom_debug_handlers to just use zend_mm_set_custom_handlers(), saving some conditionals when the Zend allocator is not used.

show more ...


# 016c3861 01-Dec-2023 Ilija Tovilo

Fix asan false positive for mmap

For some reason, mmap regions which are repeatedly munmapped are not correctly
unpoisoned. See https://github.com/google/sanitizers/issues/1705.

Fix asan false positive for mmap

For some reason, mmap regions which are repeatedly munmapped are not correctly
unpoisoned. See https://github.com/google/sanitizers/issues/1705.

Fixes GH-12756
Closes GH-12848

show more ...


# 28110f8d 05-Nov-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix unspecified behaviour in zend_alloc in heap->limit computation

Right-shifting a negative number is unspecified (i.e.
implementation-defined) behaviour [1]. If we take a look at the

Fix unspecified behaviour in zend_alloc in heap->limit computation

Right-shifting a negative number is unspecified (i.e.
implementation-defined) behaviour [1]. If we take a look at the
generated assembly [2], we see that the wrong value is computed.
Fix it by using Z_UL instead of Z_L.

While we're at it, just change every occurrence of this pattern to use
Z_UL instead of casting.

[1] https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1548.pdf §6.5.7.5
[2] https://godbolt.org/z/4Y1qKKjsh

Closes GH-12613.

show more ...


# 2227fefa 14-Sep-2023 Ilija Tovilo

Fix noreturn with warning that should be an error

E_WARNING does not actually abort.


# 3148da8e 03-Aug-2023 Ilija Tovilo

Add block size support for tracked_malloc (#11856)

This does still deviate from USE_ZEND_ALLOC=0 in that we're not rounding up the
size of the allocation to fixed sizes. Doing so would s

Add block size support for tracked_malloc (#11856)

This does still deviate from USE_ZEND_ALLOC=0 in that we're not rounding up the
size of the allocation to fixed sizes. Doing so would suppress some
out-of-bounds errors checked by ASAN. Rounding up the size in
_zend_mm_block_size would not be good either as it would break code like
memset(ptr, 0 _zend_mm_block_size(ptr)).

show more ...


# 4553258d 01-Aug-2023 Dmitry Stogov

Fixed incorrect tracked malloc deallocation

Fixes ext/ffi/tests/list.phpt failure


# fc88f155 03-Apr-2023 Ilija Tovilo

Add zend_alloc XLEAK support

In the future we may want to use a different exit code to warn for tests that
didn't leak.

Closes GH-10999


# c0d89e54 18-Feb-2023 Max Kellermann

Zend/zend_alloc: make stderr_last_error() static (#10587)

This function is only used internally.


# 413844d6 18-Feb-2023 Max Kellermann

Zend/zend_types.h: deprecate zend_bool, zend_intptr_t, zend_uintptr_t (#10597)

These types are standard C99.

For compatibility with out-of-tree extensions, keep the typedefs
in

Zend/zend_types.h: deprecate zend_bool, zend_intptr_t, zend_uintptr_t (#10597)

These types are standard C99.

For compatibility with out-of-tree extensions, keep the typedefs
in main/php.h.

show more ...


# 2d3427c5 16-Jan-2023 Christoph M. Becker

Revert "#include cleanup (#10216)"

Cf. <https://github.com/php/php-src/pull/10220#issuecomment-1383739816>.

This reverts commit e628c66f9d4173e585081ddef358505433f9a288.


# e628c66f 04-Jan-2023 Max Kellermann

#include cleanup (#10216)

Shift header include

In the C file, include the header first so missing #includes are
detected by the compiler, and use lighter header dependencies in

#include cleanup (#10216)

Shift header include

In the C file, include the header first so missing #includes are
detected by the compiler, and use lighter header dependencies in the
header, to speed up compile times.

show more ...


# 8d65c2fe 14-Nov-2022 Michael Voříšek

Fix GH-9650: Can't initialize heap: [0x000001e7]

Closes GH-9721.


Revision tags: php-8.2.0RC1, php-8.1.10, php-8.0.23, php-8.0.23RC1, php-8.1.10RC1, php-8.2.0beta3
# 98bdb7f9 12-Aug-2022 Ilija Tovilo

Make pestr[n]dup infallible (#9295)

Fixes GH-9128
Closes GH-9295

Revision tags: php-8.2.0beta2, php-8.1.9, php-8.0.22, php-8.1.9RC1, php-8.2.0beta1, php-8.0.22RC1, php-8.0.21, php-8.1.8, php-8.2.0alpha3, php-8.1.8RC1, php-8.2.0alpha2
# cd363a9b 21-Jun-2022 Ilija Tovilo

Specify unit in out of memory error (#8820)

Closes GH-8808

Revision tags: php-8.0.21RC1
# e67565f5 20-Jun-2022 Max Kellermann

Zend, ext/opcache: use PR_SET_VMA_ANON_NAME (Linux 5.17) (#8234)

The new Linux 5.17 feature PR_SET_VMA_ANON_NAME can give names to
anonymous private memory, see:

https://lwn.ne

Zend, ext/opcache: use PR_SET_VMA_ANON_NAME (Linux 5.17) (#8234)

The new Linux 5.17 feature PR_SET_VMA_ANON_NAME can give names to
anonymous private memory, see:

https://lwn.net/Articles/867818/

It can be useful while debugging, to identify which portion of the
process's memory belongs to which subsystem.

This is how /proc/PID/maps can look like:

555ccd400000-555ccdc00000 r-xp 00000000 00:00 0 [anon:huge_code_pages]
7f6ec6600000-7f6ec6800000 rw-p 00000000 00:00 0 [anon:zend_alloc]

The first mapping is the PHP executable copied to anonymous memory by
option "opcache.huge_code_pages". The second one is a memory area for
the "zend_alloc.h" memory allocator library.

Unfortunately, it is not possible to give names to shared memory
(MAP_SHARED), because Linux MAP_SHARED really maps /dev/zero (see
shmem_zero_setup()), which makes madvise_vma_anon_name() believe this
is a file mapping, failing the prctl() with EBADF.

show more ...

Revision tags: php-8.0.20, php-8.1.7, php-8.2.0alpha1, php-7.4.30, php-8.1.7RC1, php-8.0.20RC1
# 96838129 21-May-2022 Arnaud Le Blanc

Panic with abort() (#8590)

Revision tags: php-8.1.6, php-8.0.19, php-8.1.6RC1, php-8.0.19RC1, php-8.0.18, php-8.1.5, php-7.4.29, php-8.1.5RC1, php-8.0.18RC1, php-8.1.4, php-8.0.17, php-8.1.4RC1, php-8.0.17RC1, php-8.1.3, php-8.0.16, php-7.4.28, php-8.1.3RC1, php-8.0.16RC1, php-8.1.2, php-8.0.15, php-8.1.2RC1, php-8.0.15RC1
# 31692a16 21-Dec-2021 David CARLIER

Support zend alloc USE_ZEND_ALLOC_HUGE_PAGES option on MacOS

ZEND_MM_CHUNK_SIZE fits the VM_FLAGS_SUPERPAGE_SIZE_2MB special
file descriptor for mmap call.

# ca134f7a 20-Mar-2022 Ilija Tovilo

Remove unused include of stdbool.h

# a83cc9d3 20-Mar-2022 Max Kellermann

Zend/zend_alloc: use bool and make internal variable static (#8230)

* Zend/zend_alloc: make zend_mm_use_huge_pages static

This is an internal variable and it should not be exported.

Zend/zend_alloc: use bool and make internal variable static (#8230)

* Zend/zend_alloc: make zend_mm_use_huge_pages static

This is an internal variable and it should not be exported.

* Zend/zend_alloc: convert zend_mm_use_huge_pages to bool

* Zend/zend_alloc: convert has_free_pages to bool

* Zend/zend_alloc: convert empty to bool

show more ...

# c9385ee1 19-Mar-2022 David CARLIER

zend_mm_map_fixed using MAP_TRYFIXED on NetBSD.DragonFlyBSD

attempts to map on addr but does not replace it if already present.
Note on OpenBSD it has no effect, addr is used just as a h

zend_mm_map_fixed using MAP_TRYFIXED on NetBSD.DragonFlyBSD

attempts to map on addr but does not replace it if already present.
Note on OpenBSD it has no effect, addr is used just as a hint.

Closes GH-7923.

show more ...

# 67440096 04-Mar-2022 Patrick Allaert

Added: [zend_]memory_reset_peak_usage() (#8151)

# 8c60e215 24-Feb-2022 Patrick Allaert

Avoid possible [-Wstrict-prototypes] build warnings

# 68a51e33 08-Feb-2022 Dmitry Stogov

Merge branch 'PHP-8.1'

* PHP-8.1:
Free cached chunks when the requested memory limit is above real usage


12345678910>>...21