php-internal-docs 8.4.8
Unofficial docs for php/php-src
|
#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 |
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 |
Definition at line 360 of file zend_alloc.c.
Definition at line 365 of file zend_alloc.c.
Definition at line 355 of file zend_alloc.c.
Definition at line 2578 of file zend_alloc.c.
Definition at line 221 of file zend_alloc.c.
Definition at line 98 of file zend_alloc.c.
#define MAP_POPULATE 0 |
Definition at line 101 of file zend_alloc.c.
#define REAL_PAGE_SIZE ZEND_MM_PAGE_SIZE |
Definition at line 113 of file zend_alloc.c.
Definition at line 181 of file zend_alloc.c.
Definition at line 179 of file zend_alloc.c.
#define ZEND_MM_BINS 30 |
Definition at line 218 of file zend_alloc.c.
#define ZEND_MM_BITSET_LEN (sizeof(zend_mm_bitset) * 8) /* 32 or 64 */ |
Definition at line 186 of file zend_alloc.c.
#define ZEND_MM_CHECK | ( | condition, | |
message ) |
Definition at line 169 of file zend_alloc.c.
Definition at line 139 of file zend_alloc.c.
Definition at line 146 of file zend_alloc.c.
#define ZEND_MM_FD -1 |
Definition at line 123 of file zend_alloc.c.
#define ZEND_MM_FREE_SLOT_PTR_SHADOW | ( | free_slot, | |
bin_num ) |
Definition at line 1291 of file zend_alloc.c.
#define ZEND_MM_FRUN | ( | ) |
Definition at line 212 of file zend_alloc.c.
#define ZEND_MM_HEAP_PROTECTION 1 /* protect heap against corruptions */ |
Definition at line 149 of file zend_alloc.c.
#define ZEND_MM_IS_FRUN 0x00000000 |
Definition at line 191 of file zend_alloc.c.
#define ZEND_MM_IS_LRUN 0x40000000 |
Definition at line 192 of file zend_alloc.c.
#define ZEND_MM_IS_SRUN 0x80000000 |
Definition at line 193 of file zend_alloc.c.
Definition at line 136 of file zend_alloc.c.
Definition at line 213 of file zend_alloc.c.
#define ZEND_MM_LRUN_PAGES | ( | info | ) |
Definition at line 207 of file zend_alloc.c.
#define ZEND_MM_LRUN_PAGES_MASK 0x000003ff |
Definition at line 195 of file zend_alloc.c.
#define ZEND_MM_LRUN_PAGES_OFFSET 0 |
Definition at line 196 of file zend_alloc.c.
#define ZEND_MM_MIN_USEABLE_BIN_SIZE 16 |
Definition at line 155 of file zend_alloc.c.
Definition at line 216 of file zend_alloc.c.
#define ZEND_MM_NRUN_OFFSET | ( | info | ) |
Definition at line 210 of file zend_alloc.c.
#define ZEND_MM_NRUN_OFFSET_MASK 0x01ff0000 |
Definition at line 204 of file zend_alloc.c.
#define ZEND_MM_NRUN_OFFSET_OFFSET 16 |
Definition at line 205 of file zend_alloc.c.
#define ZEND_MM_PAGE_ADDR | ( | chunk, | |
page_num ) |
Definition at line 352 of file zend_alloc.c.
#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.
Definition at line 183 of file zend_alloc.c.
Definition at line 1276 of file zend_alloc.c.
#define ZEND_MM_SRUN | ( | bin_num | ) |
Definition at line 214 of file zend_alloc.c.
#define ZEND_MM_SRUN_BIN_NUM | ( | info | ) |
Definition at line 208 of file zend_alloc.c.
#define ZEND_MM_SRUN_BIN_NUM_MASK 0x0000001f |
Definition at line 198 of file zend_alloc.c.
#define ZEND_MM_SRUN_BIN_NUM_OFFSET 0 |
Definition at line 199 of file zend_alloc.c.
Definition at line 215 of file zend_alloc.c.
#define ZEND_MM_SRUN_FREE_COUNTER | ( | info | ) |
Definition at line 209 of file zend_alloc.c.
#define ZEND_MM_SRUN_FREE_COUNTER_MASK 0x01ff0000 |
Definition at line 201 of file zend_alloc.c.
#define ZEND_MM_SRUN_FREE_COUNTER_OFFSET 16 |
Definition at line 202 of file zend_alloc.c.
Definition at line 133 of file zend_alloc.c.
Definition at line 143 of file zend_alloc.c.
typedef struct _zend_alloc_globals zend_alloc_globals |
typedef struct _zend_mm_bin zend_mm_bin |
Definition at line 227 of file zend_alloc.c.
typedef zend_ulong zend_mm_bitset |
Definition at line 177 of file zend_alloc.c.
typedef struct _zend_mm_chunk zend_mm_chunk |
Definition at line 229 of file zend_alloc.c.
typedef struct _zend_mm_free_slot zend_mm_free_slot |
Definition at line 228 of file zend_alloc.c.
typedef struct _zend_mm_huge_list zend_mm_huge_list |
Definition at line 230 of file zend_alloc.c.
typedef struct _zend_mm_page zend_mm_page |
Definition at line 226 of file zend_alloc.c.
typedef uint32_t zend_mm_page_info |
Definition at line 176 of file zend_alloc.c.
typedef zend_mm_bitset zend_mm_page_map[ZEND_MM_PAGE_MAP_LEN] |
Definition at line 189 of file zend_alloc.c.
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_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_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_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_API char * __zend_strdup | ( | const char * | s | ) |
Definition at line 3312 of file zend_alloc.c.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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_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_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_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_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.
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.
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.
Definition at line 2582 of file zend_alloc.c.
Definition at line 2591 of file zend_alloc.c.
Definition at line 2922 of file zend_alloc.c.
Definition at line 3069 of file zend_alloc.c.
Definition at line 2880 of file zend_alloc.c.
ZEND_API size_t zend_memory_peak_usage | ( | bool | real_usage | ) |
Definition at line 2902 of file zend_alloc.c.
Definition at line 2914 of file zend_alloc.c.
ZEND_API size_t zend_memory_usage | ( | bool | real_usage | ) |
Definition at line 2889 of file zend_alloc.c.
ZEND_API size_t zend_mm_gc | ( | zend_mm_heap * | heap | ) |
Definition at line 2072 of file zend_alloc.c.
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_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_API zend_mm_heap * zend_mm_get_heap | ( | void | ) |
Definition at line 3094 of file zend_alloc.c.
ZEND_API zend_mm_storage * zend_mm_get_storage | ( | zend_mm_heap * | heap | ) |
Definition at line 3191 of file zend_alloc.c.
ZEND_API bool zend_mm_is_custom_heap | ( | zend_mm_heap * | new_heap | ) |
Definition at line 3099 of file zend_alloc.c.
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_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_API zend_mm_heap * zend_mm_set_heap | ( | zend_mm_heap * | new_heap | ) |
Definition at line 3085 of file zend_alloc.c.
ZEND_API void zend_mm_shutdown | ( | zend_mm_heap * | heap, |
bool | full, | ||
bool | silent ) |
Definition at line 2394 of file zend_alloc.c.
ZEND_API zend_mm_heap * zend_mm_startup | ( | void | ) |
Definition at line 3200 of file zend_alloc.c.
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_API zend_result zend_set_memory_limit | ( | size_t | memory_limit | ) |
Definition at line 2856 of file zend_alloc.c.
ZEND_API char *ZEND_FASTCALL zend_strndup | ( | const char * | s, |
size_t | length ) |
Definition at line 2838 of file zend_alloc.c.