Skip to content

Commit

Permalink
Remove zephir_create_symbol_table function
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeckerson committed Nov 26, 2023
1 parent 86e5168 commit 3d0befe
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 43 deletions.
41 changes: 0 additions & 41 deletions kernel/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,47 +75,6 @@ void zephir_deinitialize_memory()
zephir_globals_ptr->initialized = 0;
}

/**
* Creates a virtual symbol tables dynamically
*/
void zephir_create_symbol_table(zephir_method_globals *gptr)
{
zephir_symbol_table *entry;
zend_array *symbol_table;

#ifndef ZEPHIR_RELEASE
if (!gptr->active_memory) {
fprintf(stderr, "ERROR: Trying to create a virtual symbol table without a memory frame");
zephir_print_backtrace();
return;
}
#endif

zend_execute_data* ex = find_symbol_table(EG(current_execute_data));
#ifndef ZEPHIR_RELEASE
if (UNEXPECTED(!ex)) {
fprintf(stderr, "ERROR: unable to find a symbol table");
zephir_print_backtrace();
return;
}
#endif

zend_rebuild_symbol_table();
zend_detach_symbol_table(ex);

entry = (zephir_symbol_table*)emalloc(sizeof(zephir_symbol_table));
entry->scope = gptr->active_memory;
entry->symbol_table = ex->symbol_table;
entry->prev = gptr->active_symbol_table;

symbol_table = (zend_array*)emalloc(sizeof(zend_array));
zend_hash_init(symbol_table, 0, NULL, ZVAL_PTR_DTOR, 0);
zend_hash_real_init(symbol_table, 0);

ex->symbol_table = symbol_table;
gptr->active_symbol_table = entry;
}

/**
* Exports symbols to the active symbol table
*/
Expand Down
2 changes: 0 additions & 2 deletions kernel/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ void ZEPHIR_FASTCALL zephir_do_memory_observe(zval *var, const zephir_method_glo

#define zephir_safe_zval_ptr_dtor(pzval)

void zephir_create_symbol_table(zephir_method_globals *g);

int zephir_set_symbol(zval *key_name, zval *value);

#define ZEPHIR_INIT_VAR(z) \
Expand Down

0 comments on commit 3d0befe

Please sign in to comment.