Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 6f78ef8

Browse files
remove is_zend_mm() check
1 parent 125727a commit 6f78ef8

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

‎Zend/zend_alloc.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2411,7 +2411,7 @@ void* ZEND_FASTCALL _zend_mm_realloc2(zend_mm_heap *heap, void *ptr, size_t size
24112411
ZEND_API size_t ZEND_FASTCALL _zend_mm_block_size(zend_mm_heap *heap, void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
24122412
{
24132413
#if ZEND_MM_CUSTOM
2414-
if (UNEXPECTED(heap->use_custom_heap)) {
2414+
if (UNEXPECTED(heap->use_custom_heap& ~ZEND_MM_CUSTOM_HEAP_OBSERVED)) {
24152415
if (heap->custom_heap.std._malloc == tracked_malloc) {
24162416
zend_ulong h = ((uintptr_t) ptr) >> ZEND_MM_ALIGNMENT_LOG2;
24172417
zval *size_zv = zend_hash_index_find(heap->tracked_allocs, h);

‎ext/zend_test/zend_mm_observer.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
static void zend_mm_test_observer_malloc(size_t len, void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
2525
{
2626
size_t block_len = 0;
27-
if (is_zend_mm() &&is_zend_ptr(ptr)) {
27+
if (is_zend_ptr(ptr)) {
2828
block_len = zend_mm_block_size(zend_mm_get_heap(), ptr);
2929
}
3030
printf("malloc %p of size %zu (block: %zu)\n", ptr, len, block_len);
@@ -34,7 +34,7 @@ static void zend_mm_test_observer_malloc(size_t len, void *ptr ZEND_FILE_LINE_DC
3434
static void zend_mm_test_observer_free(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
3535
{
3636
size_t block_len = 0;
37-
if (is_zend_mm() &&is_zend_ptr(ptr)) {
37+
if (is_zend_ptr(ptr)) {
3838
block_len = zend_mm_block_size(zend_mm_get_heap(), ptr);
3939
}
4040
printf("freed %p of size %zu\n", ptr, block_len);
@@ -44,7 +44,7 @@ static void zend_mm_test_observer_free(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LIN
4444
static void zend_mm_test_observer_realloc(void *ptr, size_t len, void *newptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
4545
{
4646
size_t block_len = 0;
47-
if (is_zend_mm() &&is_zend_ptr(ptr)) {
47+
if (is_zend_ptr(ptr)) {
4848
block_len = zend_mm_block_size(zend_mm_get_heap(), ptr);
4949
}
5050
printf("realloc %p of size %zu (block: %zu, former %p)\n", newptr, len, block_len, ptr);

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /