php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
zend_alloc.c File Reference
#include "zend.h"
#include "zend_alloc.h"
#include "zend_globals.h"
#include "zend_hrtime.h"
#include "zend_operators.h"
#include "zend_multiply.h"
#include "zend_bitset.h"
#include "zend_mmap.h"
#include "zend_portability.h"
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <limits.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/mman.h>

Go to the source code of this file.

Data Structures

struct  _zend_mm_heap
 
struct  _zend_mm_chunk
 
struct  _zend_mm_page
 
struct  _zend_mm_bin
 
struct  _zend_mm_free_slot
 
struct  _zend_mm_huge_list
 
struct  _zend_alloc_globals
 

Macros

#define MAP_FAILED   ((void*)-1)
 
#define MAP_POPULATE   0
 
#define REAL_PAGE_SIZE   ZEND_MM_PAGE_SIZE
 
#define ZEND_MM_FD   -1
 
#define ZEND_MM_STAT   1 /* track current and peak memory usage */
 
#define ZEND_MM_LIMIT   1 /* support for user-defined memory limit */
 
#define ZEND_MM_CUSTOM   1 /* support for custom memory allocator */
 
#define ZEND_MM_STORAGE   1 /* support for custom memory storage */
 
#define ZEND_MM_ERROR   1 /* report system errors */
 
#define ZEND_MM_HEAP_PROTECTION   1 /* protect heap against corruptions */
 
#define ZEND_MM_MIN_USEABLE_BIN_SIZE   16
 
#define ZEND_MM_CHECK(condition, message)
 
#define ZEND_MM_ALIGNED_OFFSET(size, alignment)
 
#define ZEND_MM_ALIGNED_BASE(size, alignment)
 
#define ZEND_MM_SIZE_TO_NUM(size, alignment)
 
#define ZEND_MM_BITSET_LEN   (sizeof(zend_mm_bitset) * 8) /* 32 or 64 */
 
#define ZEND_MM_PAGE_MAP_LEN   (ZEND_MM_PAGES / ZEND_MM_BITSET_LEN) /* 16 or 8 */
 
#define ZEND_MM_IS_FRUN   0x00000000
 
#define ZEND_MM_IS_LRUN   0x40000000
 
#define ZEND_MM_IS_SRUN   0x80000000
 
#define ZEND_MM_LRUN_PAGES_MASK   0x000003ff
 
#define ZEND_MM_LRUN_PAGES_OFFSET   0
 
#define ZEND_MM_SRUN_BIN_NUM_MASK   0x0000001f
 
#define ZEND_MM_SRUN_BIN_NUM_OFFSET   0
 
#define ZEND_MM_SRUN_FREE_COUNTER_MASK   0x01ff0000
 
#define ZEND_MM_SRUN_FREE_COUNTER_OFFSET   16
 
#define ZEND_MM_NRUN_OFFSET_MASK   0x01ff0000
 
#define ZEND_MM_NRUN_OFFSET_OFFSET   16
 
#define ZEND_MM_LRUN_PAGES(info)
 
#define ZEND_MM_SRUN_BIN_NUM(info)
 
#define ZEND_MM_SRUN_FREE_COUNTER(info)
 
#define ZEND_MM_NRUN_OFFSET(info)
 
#define ZEND_MM_FRUN()
 
#define ZEND_MM_LRUN(count)
 
#define ZEND_MM_SRUN(bin_num)
 
#define ZEND_MM_SRUN_EX(bin_num, count)
 
#define ZEND_MM_NRUN(bin_num, offset)
 
#define ZEND_MM_BINS   30
 
#define BSWAPPTR(u)
 
#define ZEND_MM_PAGE_ADDR(chunk, page_num)
 
#define _BIN_DATA_SIZE(num, size, elements, pages, x, y)
 
#define _BIN_DATA_ELEMENTS(num, size, elements, pages, x, y)
 
#define _BIN_DATA_PAGES(num, size, elements, pages, x, y)
 
#define ZEND_MM_SMALL_SIZE_TO_BIN(size)
 
#define ZEND_MM_FREE_SLOT_PTR_SHADOW(free_slot, bin_num)
 
#define AG(v)
 

Typedefs

typedef uint32_t zend_mm_page_info
 
typedef zend_ulong zend_mm_bitset
 
typedef zend_mm_bitset zend_mm_page_map[ZEND_MM_PAGE_MAP_LEN]
 
typedef struct _zend_mm_page zend_mm_page
 
typedef struct _zend_mm_bin zend_mm_bin
 
typedef struct _zend_mm_free_slot zend_mm_free_slot
 
typedef struct _zend_mm_chunk zend_mm_chunk
 
typedef struct _zend_mm_huge_list zend_mm_huge_list
 
typedef struct _zend_alloc_globals zend_alloc_globals
 

Functions

ZEND_API size_t zend_mm_gc (zend_mm_heap *heap)
 
ZEND_API void zend_mm_shutdown (zend_mm_heap *heap, bool full, bool silent)
 
ZEND_API void *ZEND_FASTCALL _zend_mm_alloc (zend_mm_heap *heap, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
 
ZEND_API void ZEND_FASTCALL _zend_mm_free (zend_mm_heap *heap, void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
 
void *ZEND_FASTCALL _zend_mm_realloc (zend_mm_heap *heap, void *ptr, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
 
void *ZEND_FASTCALL _zend_mm_realloc2 (zend_mm_heap *heap, void *ptr, size_t size, size_t copy_size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
 
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)
 
ZEND_API bool is_zend_mm (void)
 
ZEND_API bool is_zend_ptr (const void *ptr)
 
ZEND_API void *ZEND_FASTCALL _emalloc (size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
 
ZEND_API void ZEND_FASTCALL _efree (void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
 
ZEND_API void *ZEND_FASTCALL _erealloc (void *ptr, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
 
ZEND_API void *ZEND_FASTCALL _erealloc2 (void *ptr, size_t size, size_t copy_size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
 
ZEND_API size_t ZEND_FASTCALL _zend_mem_block_size (void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
 
ZEND_API void *ZEND_FASTCALL _safe_emalloc (size_t nmemb, size_t size, size_t offset ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
 
ZEND_API void *ZEND_FASTCALL _safe_malloc (size_t nmemb, size_t size, size_t offset)
 
ZEND_API void *ZEND_FASTCALL _safe_erealloc (void *ptr, size_t nmemb, size_t size, size_t offset ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
 
ZEND_API void *ZEND_FASTCALL _safe_realloc (void *ptr, size_t nmemb, size_t size, size_t offset)
 
ZEND_API void *ZEND_FASTCALL _ecalloc (size_t nmemb, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
 
ZEND_API char *ZEND_FASTCALL _estrdup (const char *s ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
 
ZEND_API char *ZEND_FASTCALL _estrndup (const char *s, size_t length ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
 
ZEND_API char *ZEND_FASTCALL zend_strndup (const char *s, size_t length)
 
ZEND_API zend_result zend_set_memory_limit (size_t memory_limit)
 
ZEND_API bool zend_alloc_in_memory_limit_error_reporting (void)
 
ZEND_API size_t zend_memory_usage (bool real_usage)
 
ZEND_API size_t zend_memory_peak_usage (bool real_usage)
 
ZEND_API void zend_memory_reset_peak_usage (void)
 
ZEND_API void shutdown_memory_manager (bool silent, bool full_shutdown)
 
ZEND_API void start_memory_manager (void)
 
ZEND_API zend_mm_heapzend_mm_set_heap (zend_mm_heap *new_heap)
 
ZEND_API zend_mm_heapzend_mm_get_heap (void)
 
ZEND_API bool zend_mm_is_custom_heap (zend_mm_heap *new_heap)
 
ZEND_API void zend_mm_set_custom_handlers (zend_mm_heap *heap, void *(*_malloc)(size_t ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC), void(*_free)(void *ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC), void *(*_realloc)(void *, size_t ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC))
 
ZEND_API void zend_mm_set_custom_handlers_ex (zend_mm_heap *heap, void *(*_malloc)(size_t ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC), void(*_free)(void *ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC), void *(*_realloc)(void *, size_t ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC), size_t(*_gc)(void), void(*_shutdown)(bool, bool))
 
ZEND_API void zend_mm_get_custom_handlers (zend_mm_heap *heap, void *(**_malloc)(size_t ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC), void(**_free)(void *ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC), void *(**_realloc)(void *, size_t ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC))
 
ZEND_API void zend_mm_get_custom_handlers_ex (zend_mm_heap *heap, void *(**_malloc)(size_t ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC), void(**_free)(void *ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC), void *(**_realloc)(void *, size_t ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC), size_t(**_gc)(void), void(**_shutdown)(bool, bool))
 
ZEND_API zend_mm_storagezend_mm_get_storage (zend_mm_heap *heap)
 
ZEND_API zend_mm_heapzend_mm_startup (void)
 
ZEND_API zend_mm_heapzend_mm_startup_ex (const zend_mm_handlers *handlers, void *data, size_t data_size)
 
ZEND_API void__zend_malloc (size_t len ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
 
ZEND_API void__zend_calloc (size_t nmemb, size_t len ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
 
ZEND_API void__zend_realloc (void *p, size_t len ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
 
ZEND_API void __zend_free (void *p ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
 
ZEND_API char * __zend_strdup (const char *s)
 

Macro Definition Documentation

◆ _BIN_DATA_ELEMENTS

#define _BIN_DATA_ELEMENTS ( num,
size,
elements,
pages,
x,
y )
Value:
elements,

Definition at line 360 of file zend_alloc.c.

◆ _BIN_DATA_PAGES

#define _BIN_DATA_PAGES ( num,
size,
elements,
pages,
x,
y )
Value:
pages,

Definition at line 365 of file zend_alloc.c.

◆ _BIN_DATA_SIZE

#define _BIN_DATA_SIZE ( num,
size,
elements,
pages,
x,
y )
Value:
new_type size
Definition ffi.c:4365

Definition at line 355 of file zend_alloc.c.

◆ AG

#define AG ( v)
Value:
(alloc_globals.v)

Definition at line 2578 of file zend_alloc.c.

◆ BSWAPPTR

#define BSWAPPTR ( u)
Value:
ZEND_BYTES_SWAP64(u)
uint32_t u
Definition cdf.c:78

Definition at line 221 of file zend_alloc.c.

◆ MAP_FAILED

#define MAP_FAILED   ((void*)-1)

Definition at line 98 of file zend_alloc.c.

◆ MAP_POPULATE

#define MAP_POPULATE   0

Definition at line 101 of file zend_alloc.c.

◆ REAL_PAGE_SIZE

#define REAL_PAGE_SIZE   ZEND_MM_PAGE_SIZE

Definition at line 113 of file zend_alloc.c.

◆ ZEND_MM_ALIGNED_BASE

#define ZEND_MM_ALIGNED_BASE ( size,
alignment )
Value:
(((size_t)(size)) & ~((alignment) - 1))

Definition at line 181 of file zend_alloc.c.

◆ ZEND_MM_ALIGNED_OFFSET

#define ZEND_MM_ALIGNED_OFFSET ( size,
alignment )
Value:
(((size_t)(size)) & ((alignment) - 1))

Definition at line 179 of file zend_alloc.c.

◆ ZEND_MM_BINS

#define ZEND_MM_BINS   30

Definition at line 218 of file zend_alloc.c.

◆ ZEND_MM_BITSET_LEN

#define ZEND_MM_BITSET_LEN   (sizeof(zend_mm_bitset) * 8) /* 32 or 64 */

Definition at line 186 of file zend_alloc.c.

◆ ZEND_MM_CHECK

#define ZEND_MM_CHECK ( condition,
message )
Value:
do { \
if (UNEXPECTED(!(condition))) { \
zend_mm_panic(message); \
} \
} while (0)
#define UNEXPECTED(condition)

Definition at line 169 of file zend_alloc.c.

◆ ZEND_MM_CUSTOM

#define ZEND_MM_CUSTOM   1 /* support for custom memory allocator */

Definition at line 139 of file zend_alloc.c.

◆ ZEND_MM_ERROR

#define ZEND_MM_ERROR   1 /* report system errors */

Definition at line 146 of file zend_alloc.c.

◆ ZEND_MM_FD

#define ZEND_MM_FD   -1

Definition at line 123 of file zend_alloc.c.

◆ ZEND_MM_FREE_SLOT_PTR_SHADOW

#define ZEND_MM_FREE_SLOT_PTR_SHADOW ( free_slot,
bin_num )
Value:
*((zend_mm_free_slot**)((char*)(free_slot) + bin_data_size[(bin_num)] - sizeof(zend_mm_free_slot*)))
struct _zend_mm_free_slot zend_mm_free_slot
Definition zend_alloc.c:228

Definition at line 1291 of file zend_alloc.c.

◆ ZEND_MM_FRUN

#define ZEND_MM_FRUN ( )
Value:
#define ZEND_MM_IS_FRUN
Definition zend_alloc.c:191

Definition at line 212 of file zend_alloc.c.

◆ ZEND_MM_HEAP_PROTECTION

#define ZEND_MM_HEAP_PROTECTION   1 /* protect heap against corruptions */

Definition at line 149 of file zend_alloc.c.

◆ ZEND_MM_IS_FRUN

#define ZEND_MM_IS_FRUN   0x00000000

Definition at line 191 of file zend_alloc.c.

◆ ZEND_MM_IS_LRUN

#define ZEND_MM_IS_LRUN   0x40000000

Definition at line 192 of file zend_alloc.c.

◆ ZEND_MM_IS_SRUN

#define ZEND_MM_IS_SRUN   0x80000000

Definition at line 193 of file zend_alloc.c.

◆ ZEND_MM_LIMIT

#define ZEND_MM_LIMIT   1 /* support for user-defined memory limit */

Definition at line 136 of file zend_alloc.c.

◆ ZEND_MM_LRUN

#define ZEND_MM_LRUN ( count)
Value:
count(Countable|array $value, int $mode=COUNT_NORMAL)
#define ZEND_MM_LRUN_PAGES_OFFSET
Definition zend_alloc.c:196
#define ZEND_MM_IS_LRUN
Definition zend_alloc.c:192

Definition at line 213 of file zend_alloc.c.

◆ ZEND_MM_LRUN_PAGES

#define ZEND_MM_LRUN_PAGES ( info)
Value:
#define ZEND_MM_LRUN_PAGES_MASK
Definition zend_alloc.c:195

Definition at line 207 of file zend_alloc.c.

◆ ZEND_MM_LRUN_PAGES_MASK

#define ZEND_MM_LRUN_PAGES_MASK   0x000003ff

Definition at line 195 of file zend_alloc.c.

◆ ZEND_MM_LRUN_PAGES_OFFSET

#define ZEND_MM_LRUN_PAGES_OFFSET   0

Definition at line 196 of file zend_alloc.c.

◆ ZEND_MM_MIN_USEABLE_BIN_SIZE

#define ZEND_MM_MIN_USEABLE_BIN_SIZE   16

Definition at line 155 of file zend_alloc.c.

◆ ZEND_MM_NRUN

#define ZEND_MM_NRUN ( bin_num,
offset )
Value:
zend_long offset
#define ZEND_MM_NRUN_OFFSET_OFFSET
Definition zend_alloc.c:205
#define ZEND_MM_SRUN_BIN_NUM_OFFSET
Definition zend_alloc.c:199
#define ZEND_MM_IS_SRUN
Definition zend_alloc.c:193

Definition at line 216 of file zend_alloc.c.

◆ ZEND_MM_NRUN_OFFSET

#define ZEND_MM_NRUN_OFFSET ( info)
Value:
#define ZEND_MM_NRUN_OFFSET_MASK
Definition zend_alloc.c:204

Definition at line 210 of file zend_alloc.c.

◆ ZEND_MM_NRUN_OFFSET_MASK

#define ZEND_MM_NRUN_OFFSET_MASK   0x01ff0000

Definition at line 204 of file zend_alloc.c.

◆ ZEND_MM_NRUN_OFFSET_OFFSET

#define ZEND_MM_NRUN_OFFSET_OFFSET   16

Definition at line 205 of file zend_alloc.c.

◆ ZEND_MM_PAGE_ADDR

#define ZEND_MM_PAGE_ADDR ( chunk,
page_num )
Value:
((void*)(((zend_mm_page*)(chunk)) + (page_num)))
struct _zend_mm_page zend_mm_page
Definition zend_alloc.c:226

Definition at line 352 of file zend_alloc.c.

◆ ZEND_MM_PAGE_MAP_LEN

#define ZEND_MM_PAGE_MAP_LEN   (ZEND_MM_PAGES / ZEND_MM_BITSET_LEN) /* 16 or 8 */

Definition at line 187 of file zend_alloc.c.

◆ ZEND_MM_SIZE_TO_NUM

#define ZEND_MM_SIZE_TO_NUM ( size,
alignment )
Value:
(((size_t)(size) + ((alignment) - 1)) / (alignment))

Definition at line 183 of file zend_alloc.c.

◆ ZEND_MM_SMALL_SIZE_TO_BIN

#define ZEND_MM_SMALL_SIZE_TO_BIN ( size)
Value:
zend_mm_small_size_to_bin(size)

Definition at line 1276 of file zend_alloc.c.

◆ ZEND_MM_SRUN

#define ZEND_MM_SRUN ( bin_num)
Value:

Definition at line 214 of file zend_alloc.c.

◆ ZEND_MM_SRUN_BIN_NUM

#define ZEND_MM_SRUN_BIN_NUM ( info)
Value:
#define ZEND_MM_SRUN_BIN_NUM_MASK
Definition zend_alloc.c:198

Definition at line 208 of file zend_alloc.c.

◆ ZEND_MM_SRUN_BIN_NUM_MASK

#define ZEND_MM_SRUN_BIN_NUM_MASK   0x0000001f

Definition at line 198 of file zend_alloc.c.

◆ ZEND_MM_SRUN_BIN_NUM_OFFSET

#define ZEND_MM_SRUN_BIN_NUM_OFFSET   0

Definition at line 199 of file zend_alloc.c.

◆ ZEND_MM_SRUN_EX

#define ZEND_MM_SRUN_EX ( bin_num,
count )
Value:

Definition at line 215 of file zend_alloc.c.

◆ ZEND_MM_SRUN_FREE_COUNTER

#define ZEND_MM_SRUN_FREE_COUNTER ( info)
Value:

Definition at line 209 of file zend_alloc.c.

◆ ZEND_MM_SRUN_FREE_COUNTER_MASK

#define ZEND_MM_SRUN_FREE_COUNTER_MASK   0x01ff0000

Definition at line 201 of file zend_alloc.c.

◆ ZEND_MM_SRUN_FREE_COUNTER_OFFSET

#define ZEND_MM_SRUN_FREE_COUNTER_OFFSET   16

Definition at line 202 of file zend_alloc.c.

◆ ZEND_MM_STAT

#define ZEND_MM_STAT   1 /* track current and peak memory usage */

Definition at line 133 of file zend_alloc.c.

◆ ZEND_MM_STORAGE

#define ZEND_MM_STORAGE   1 /* support for custom memory storage */

Definition at line 143 of file zend_alloc.c.

Typedef Documentation

◆ zend_alloc_globals

◆ zend_mm_bin

typedef struct _zend_mm_bin zend_mm_bin

Definition at line 227 of file zend_alloc.c.

◆ zend_mm_bitset

Definition at line 177 of file zend_alloc.c.

◆ zend_mm_chunk

typedef struct _zend_mm_chunk zend_mm_chunk

Definition at line 229 of file zend_alloc.c.

◆ zend_mm_free_slot

Definition at line 228 of file zend_alloc.c.

◆ zend_mm_huge_list

Definition at line 230 of file zend_alloc.c.

◆ zend_mm_page

typedef struct _zend_mm_page zend_mm_page

Definition at line 226 of file zend_alloc.c.

◆ zend_mm_page_info

typedef uint32_t zend_mm_page_info

Definition at line 176 of file zend_alloc.c.

◆ zend_mm_page_map

typedef zend_mm_bitset zend_mm_page_map[ZEND_MM_PAGE_MAP_LEN]

Definition at line 189 of file zend_alloc.c.

Function Documentation

◆ __zend_calloc()

ZEND_API void * __zend_calloc ( size_t nmemb,
size_t len ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC )

Definition at line 3287 of file zend_alloc.c.

◆ __zend_free()

ZEND_API void __zend_free ( void *p ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)

Definition at line 3306 of file zend_alloc.c.

◆ __zend_malloc()

ZEND_API void * __zend_malloc ( size_t len ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)

Definition at line 3278 of file zend_alloc.c.

◆ __zend_realloc()

ZEND_API void * __zend_realloc ( void * p,
size_t len ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC )

Definition at line 3297 of file zend_alloc.c.

◆ __zend_strdup()

ZEND_API char * __zend_strdup ( const char * s)

Definition at line 3312 of file zend_alloc.c.

◆ _ecalloc()

ZEND_API void *ZEND_FASTCALL _ecalloc ( size_t nmemb,
size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC )

Definition at line 2799 of file zend_alloc.c.

◆ _efree()

ZEND_API void ZEND_FASTCALL _efree ( void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)

Definition at line 2743 of file zend_alloc.c.

◆ _emalloc()

ZEND_API void *ZEND_FASTCALL _emalloc ( size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)

Definition at line 2733 of file zend_alloc.c.

◆ _erealloc()

ZEND_API void *ZEND_FASTCALL _erealloc ( void * ptr,
size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC )

Definition at line 2754 of file zend_alloc.c.

◆ _erealloc2()

ZEND_API void *ZEND_FASTCALL _erealloc2 ( void * ptr,
size_t size,
size_t copy_size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC )

Definition at line 2764 of file zend_alloc.c.

◆ _estrdup()

ZEND_API char *ZEND_FASTCALL _estrdup ( const char *s ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)

Definition at line 2809 of file zend_alloc.c.

◆ _estrndup()

ZEND_API char *ZEND_FASTCALL _estrndup ( const char * s,
size_t length ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC )

Definition at line 2823 of file zend_alloc.c.

◆ _safe_emalloc()

ZEND_API void *ZEND_FASTCALL _safe_emalloc ( size_t nmemb,
size_t size,
size_t offset ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC )

Definition at line 2779 of file zend_alloc.c.

◆ _safe_erealloc()

ZEND_API void *ZEND_FASTCALL _safe_erealloc ( void * ptr,
size_t nmemb,
size_t size,
size_t offset ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC )

Definition at line 2789 of file zend_alloc.c.

◆ _safe_malloc()

ZEND_API void *ZEND_FASTCALL _safe_malloc ( size_t nmemb,
size_t size,
size_t offset )

Definition at line 2784 of file zend_alloc.c.

◆ _safe_realloc()

ZEND_API void *ZEND_FASTCALL _safe_realloc ( void * ptr,
size_t nmemb,
size_t size,
size_t offset )

Definition at line 2794 of file zend_alloc.c.

◆ _zend_mem_block_size()

ZEND_API size_t ZEND_FASTCALL _zend_mem_block_size ( void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)

Definition at line 2774 of file zend_alloc.c.

◆ _zend_mm_alloc()

ZEND_API void *ZEND_FASTCALL _zend_mm_alloc ( zend_mm_heap * heap,
size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC )

Definition at line 2528 of file zend_alloc.c.

◆ _zend_mm_block_size()

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 )

Definition at line 2548 of file zend_alloc.c.

◆ _zend_mm_free()

ZEND_API void ZEND_FASTCALL _zend_mm_free ( zend_mm_heap * heap,
void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC )

Definition at line 2533 of file zend_alloc.c.

◆ _zend_mm_realloc()

void *ZEND_FASTCALL _zend_mm_realloc ( zend_mm_heap * heap,
void * ptr,
size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC )

Definition at line 2538 of file zend_alloc.c.

◆ _zend_mm_realloc2()

void *ZEND_FASTCALL _zend_mm_realloc2 ( zend_mm_heap * heap,
void * ptr,
size_t size,
size_t copy_size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC )

Definition at line 2543 of file zend_alloc.c.

◆ is_zend_mm()

ZEND_API bool is_zend_mm ( void )

Definition at line 2582 of file zend_alloc.c.

◆ is_zend_ptr()

ZEND_API bool is_zend_ptr ( const void * ptr)

Definition at line 2591 of file zend_alloc.c.

◆ shutdown_memory_manager()

ZEND_API void shutdown_memory_manager ( bool silent,
bool full_shutdown )

Definition at line 2922 of file zend_alloc.c.

◆ start_memory_manager()

ZEND_API void start_memory_manager ( void )

Definition at line 3069 of file zend_alloc.c.

◆ zend_alloc_in_memory_limit_error_reporting()

ZEND_API bool zend_alloc_in_memory_limit_error_reporting ( void )

Definition at line 2880 of file zend_alloc.c.

◆ zend_memory_peak_usage()

ZEND_API size_t zend_memory_peak_usage ( bool real_usage)

Definition at line 2902 of file zend_alloc.c.

◆ zend_memory_reset_peak_usage()

ZEND_API void zend_memory_reset_peak_usage ( void )

Definition at line 2914 of file zend_alloc.c.

◆ zend_memory_usage()

ZEND_API size_t zend_memory_usage ( bool real_usage)

Definition at line 2889 of file zend_alloc.c.

◆ zend_mm_gc()

ZEND_API size_t zend_mm_gc ( zend_mm_heap * heap)

Definition at line 2072 of file zend_alloc.c.

◆ zend_mm_get_custom_handlers()

ZEND_API void zend_mm_get_custom_handlers ( zend_mm_heap * heap,
void *(** _malloc )(size_t ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC),
void(** _free )(void *ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC),
void *(** _realloc )(void *, size_t ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) )

Definition at line 3141 of file zend_alloc.c.

◆ zend_mm_get_custom_handlers_ex()

ZEND_API void zend_mm_get_custom_handlers_ex ( zend_mm_heap * heap,
void *(** _malloc )(size_t ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC),
void(** _free )(void *ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC),
void *(** _realloc )(void *, size_t ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC),
size_t(** _gc )(void),
void(** _shutdown )(bool, bool) )

Definition at line 3151 of file zend_alloc.c.

◆ zend_mm_get_heap()

ZEND_API zend_mm_heap * zend_mm_get_heap ( void )

Definition at line 3094 of file zend_alloc.c.

◆ zend_mm_get_storage()

ZEND_API zend_mm_storage * zend_mm_get_storage ( zend_mm_heap * heap)

Definition at line 3191 of file zend_alloc.c.

◆ zend_mm_is_custom_heap()

ZEND_API bool zend_mm_is_custom_heap ( zend_mm_heap * new_heap)

Definition at line 3099 of file zend_alloc.c.

◆ zend_mm_set_custom_handlers()

ZEND_API void zend_mm_set_custom_handlers ( zend_mm_heap * heap,
void *(* _malloc )(size_t ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC),
void(* _free )(void *ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC),
void *(* _realloc )(void *, size_t ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC) )

Definition at line 3108 of file zend_alloc.c.

◆ zend_mm_set_custom_handlers_ex()

ZEND_API void zend_mm_set_custom_handlers_ex ( zend_mm_heap * heap,
void *(* _malloc )(size_t ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC),
void(* _free )(void *ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC),
void *(* _realloc )(void *, size_t ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC),
size_t(* _gc )(void),
void(* _shutdown )(bool, bool) )

Definition at line 3118 of file zend_alloc.c.

◆ zend_mm_set_heap()

ZEND_API zend_mm_heap * zend_mm_set_heap ( zend_mm_heap * new_heap)

Definition at line 3085 of file zend_alloc.c.

◆ zend_mm_shutdown()

ZEND_API void zend_mm_shutdown ( zend_mm_heap * heap,
bool full,
bool silent )

Definition at line 2394 of file zend_alloc.c.

◆ zend_mm_startup()

ZEND_API zend_mm_heap * zend_mm_startup ( void )

Definition at line 3200 of file zend_alloc.c.

◆ zend_mm_startup_ex()

ZEND_API zend_mm_heap * zend_mm_startup_ex ( const zend_mm_handlers * handlers,
void * data,
size_t data_size )

Definition at line 3205 of file zend_alloc.c.

◆ zend_set_memory_limit()

ZEND_API zend_result zend_set_memory_limit ( size_t memory_limit)

Definition at line 2856 of file zend_alloc.c.

◆ zend_strndup()

ZEND_API char *ZEND_FASTCALL zend_strndup ( const char * s,
size_t length )

Definition at line 2838 of file zend_alloc.c.