Ticket #895 (closed experimental: done)
Towards automatic allocation and deallocation of PMC attributes
Reported by: | NotFound | Owned by: | NotFound |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | none | Version: | 1.4.0 |
Severity: | medium | Keywords: | |
Cc: | Language: | ||
Patch status: | Platform: |
Description
Currently all PMC that use attributes must allocate and deallocate the struct that contains them during init and destroy. This is boring and error prone, and disallows or makes difficult using SUPER inside init.
I've thinked a way to avoid this: by storing the size of the struct inside the vtable, pmc_new and friends can allocate it before calling init, and will be easy to deallocate it during garbage collection when all PMC gets checked against minimal problems.
I've done some tests and looks promising.
To make easier that change, and as general cleaning, several PMC need some changes in his initialization/destruction and attribute usage. I'll refer to this ticket in the changes related to that.