Lines Matching refs:ZSMMG

124 	ZSMMG(shared_segments) = NULL;  in zend_shared_alloc_try()
125 ZSMMG(shared_segments_count) = 0; in zend_shared_alloc_try()
162 ZSMMG(shared_free) = requested_size - reserved_size; /* goes to tmp_shared_globals.shared_free */ in zend_shared_alloc_startup()
179 …res = zend_shared_alloc_try(he, requested_size, &ZSMMG(shared_segments), &ZSMMG(shared_segments_co… in zend_shared_alloc_startup()
202 …res = zend_shared_alloc_try(he, requested_size, &ZSMMG(shared_segments), &ZSMMG(shared_segments_co… in zend_shared_alloc_startup()
225 for (i = 0; i < ZSMMG(shared_segments_count); i++) { in zend_shared_alloc_startup()
226 ZSMMG(shared_segments)[i]->end = ZSMMG(shared_segments)[i]->size; in zend_shared_alloc_startup()
229 shared_segments_array_size = ZSMMG(shared_segments_count) * S_H(segment_type_size)(); in zend_shared_alloc_startup()
241 …tmp_shared_segments = zend_shared_alloc(shared_segments_array_size + ZSMMG(shared_segments_count) … in zend_shared_alloc_startup()
247 …copy_shared_segments(tmp_shared_segments, ZSMMG(shared_segments)[0], ZSMMG(shared_segments_count),… in zend_shared_alloc_startup()
252 free(ZSMMG(shared_segments)); in zend_shared_alloc_startup()
253 ZSMMG(shared_segments) = tmp_shared_segments; in zend_shared_alloc_startup()
255ZSMMG(shared_memory_state).positions = (size_t *)zend_shared_alloc(sizeof(size_t) * ZSMMG(shared_s… in zend_shared_alloc_startup()
256 if (!ZSMMG(shared_memory_state).positions) { in zend_shared_alloc_startup()
262 i = ZSMMG(shared_segments_count) - 1; in zend_shared_alloc_startup()
263 if (ZSMMG(shared_segments)[i]->size - ZSMMG(shared_segments)[i]->pos >= reserved_size) { in zend_shared_alloc_startup()
264 ZSMMG(shared_segments)[i]->end = ZSMMG(shared_segments)[i]->size - reserved_size; in zend_shared_alloc_startup()
265 ZSMMG(reserved) = (char*)ZSMMG(shared_segments)[i]->p + ZSMMG(shared_segments)[i]->end; in zend_shared_alloc_startup()
266 ZSMMG(reserved_size) = reserved_size; in zend_shared_alloc_startup()
288 …shared_segments_array_size = ZSMMG(shared_segments_count) * (S_H(segment_type_size)() + sizeof(voi… in zend_shared_alloc_shutdown()
294 …copy_shared_segments(tmp_shared_segments, ZSMMG(shared_segments)[0], ZSMMG(shared_segments_count),… in zend_shared_alloc_shutdown()
295 ZSMMG(shared_segments) = tmp_shared_segments; in zend_shared_alloc_shutdown()
297 for (i = 0; i < ZSMMG(shared_segments_count); i++) { in zend_shared_alloc_shutdown()
298 S_H(detach_segment)(ZSMMG(shared_segments)[i]); in zend_shared_alloc_shutdown()
301 free(ZSMMG(shared_segments)); in zend_shared_alloc_shutdown()
303 ZSMMG(shared_segments) = NULL; in zend_shared_alloc_shutdown()
319 for (i = 0; i < ZSMMG(shared_segments_count); i++) { in zend_shared_alloc_get_largest_free_block()
320 size_t block_size = ZSMMG(shared_segments)[i]->end - ZSMMG(shared_segments)[i]->pos; in zend_shared_alloc_get_largest_free_block()
332 …D_LONG_FMT" bytes ("ZEND_LONG_FMT" bytes free)", (zend_long)size, (zend_long)ZSMMG(shared_free)); \
334 ZSMMG(memory_exhausted) = 1; \
348 if (block_size > ZSMMG(shared_free)) { /* No hope to find a big-enough block */ in zend_shared_alloc()
352 for (i = 0; i < ZSMMG(shared_segments_count); i++) { in zend_shared_alloc()
353 …if (ZSMMG(shared_segments)[i]->end - ZSMMG(shared_segments)[i]->pos >= block_size) { /* found a va… in zend_shared_alloc()
354 …void *retval = (void *) (((char *) ZSMMG(shared_segments)[i]->p) + ZSMMG(shared_segments)[i]->pos); in zend_shared_alloc()
356 ZSMMG(shared_segments)[i]->pos += block_size; in zend_shared_alloc()
357 ZSMMG(shared_free) -= block_size; in zend_shared_alloc()
557 return ZSMMG(shared_free); in zend_shared_alloc_get_free_memory()
564 for (i = 0; i < ZSMMG(shared_segments_count); i++) { in zend_shared_alloc_save_state()
565 ZSMMG(shared_memory_state).positions[i] = ZSMMG(shared_segments)[i]->pos; in zend_shared_alloc_save_state()
567 ZSMMG(shared_memory_state).shared_free = ZSMMG(shared_free); in zend_shared_alloc_save_state()
574 for (i = 0; i < ZSMMG(shared_segments_count); i++) { in zend_shared_alloc_restore_state()
575 ZSMMG(shared_segments)[i]->pos = ZSMMG(shared_memory_state).positions[i]; in zend_shared_alloc_restore_state()
577 ZSMMG(shared_free) = ZSMMG(shared_memory_state).shared_free; in zend_shared_alloc_restore_state()
578 ZSMMG(memory_exhausted) = 0; in zend_shared_alloc_restore_state()
579 ZSMMG(wasted_shared_memory) = 0; in zend_shared_alloc_restore_state()
602 for (i = 0; i < ZSMMG(shared_segments_count); i++) { in zend_accel_shared_protect()
603 mprotect(ZSMMG(shared_segments)[i]->p, ZSMMG(shared_segments)[i]->end, mode); in zend_accel_shared_protect()
618 for (i = 0; i < ZSMMG(shared_segments_count); i++) { in zend_accel_shared_protect()
620 …if (!VirtualProtect(ZSMMG(shared_segments)[i]->p, ZSMMG(shared_segments)[i]->end, mode, &oldProtec… in zend_accel_shared_protect()
635 for (i = 0; i < ZSMMG(shared_segments_count); i++) { in zend_accel_in_shm()
636 if ((char*)ptr >= (char*)ZSMMG(shared_segments)[i]->p && in zend_accel_in_shm()
637 (char*)ptr < (char*)ZSMMG(shared_segments)[i]->p + ZSMMG(shared_segments)[i]->end) { in zend_accel_in_shm()