Skip to content

Commit

Permalink
move zend_vm_stack_new_page into header for sharing with fibers
Browse files Browse the repository at this point in the history
  • Loading branch information
krakjoe committed Jun 10, 2021
1 parent d43bc34 commit cb3964a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
9 changes: 0 additions & 9 deletions Zend/zend_execute.c
Expand Up @@ -180,15 +180,6 @@ ZEND_API const zend_internal_function zend_pass_function = {
(((size) + ZEND_VM_STACK_HEADER_SLOTS * sizeof(zval) \
+ ((page_size) - 1)) & ~((page_size) - 1))

static zend_always_inline zend_vm_stack zend_vm_stack_new_page(size_t size, zend_vm_stack prev) {
zend_vm_stack page = (zend_vm_stack)emalloc(size);

page->top = ZEND_VM_STACK_ELEMENTS(page);
page->end = (zval*)((char*)page + size);
page->prev = prev;
return page;
}

ZEND_API void zend_vm_stack_init(void)
{
EG(vm_stack_page_size) = ZEND_VM_STACK_PAGE_SIZE;
Expand Down
9 changes: 9 additions & 0 deletions Zend/zend_execute.h
Expand Up @@ -193,6 +193,15 @@ ZEND_API void zend_vm_stack_init_ex(size_t page_size);
ZEND_API void zend_vm_stack_destroy(void);
ZEND_API void* zend_vm_stack_extend(size_t size);

static zend_always_inline zend_vm_stack zend_vm_stack_new_page(size_t size, zend_vm_stack prev) {
zend_vm_stack page = (zend_vm_stack)emalloc(size);

page->top = ZEND_VM_STACK_ELEMENTS(page);
page->end = (zval*)((char*)page + size);
page->prev = prev;
return page;
}

static zend_always_inline void zend_vm_init_call_frame(zend_execute_data *call, uint32_t call_info, zend_function *func, uint32_t num_args, void *object_or_called_scope)
{
call->func = func;
Expand Down

0 comments on commit cb3964a

Please sign in to comment.