Improve how we allocate swig_object_wrapper

Use zend_object_alloc() and put the zend_object member last so that
Zend can put object properties after it.
This commit is contained in:
Olly Betts 2021-03-26 17:15:34 +13:00
commit c03679acef
2 changed files with 3 additions and 4 deletions

View file

@ -59,9 +59,9 @@ static int default_error_code = E_ERROR;
and need freeing, or not */
typedef struct {
void * ptr;
zend_object std;
HashTable *extras;
int newobject;
zend_object std;
} swig_object_wrapper;
#define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a))