Hello,

I'm trying to learn a bit more about HashTable in PHP internally and how
memory is allocated when generating arrays with various sizes. I created a
simple C script that would call

HashTable *ht = zend_new_array(15);

However, when I compile the script with gcc, I get segmentation fault; gdb
tells that the problem is located within _emalloc_56, specifically:

2535 if (UNEXPECTED(AG(mm_heap)->use_custom_heap)) {

That's how I compiled the script:
gcc -I./Zend -I. -I./TSRM -I./main Zend/*.c TSRM/TSRM.c test.c -ldl -lm -g

For the configuration I used:
./configure

Could you please guide me in the right direction? Is there something I
should do before calling zend_new_array?

Sincerely,
Ivan

Reply via email to