| 96 | } |
| 97 | |
| 98 | void |
| 99 | Schema::callConstructor(uintptr_t ext_loc) |
| 100 | { |
| 101 | ink_assert(ext_loc); |
| 102 | ++cnt_fld_constructed; // don't allow schema modification |
| 103 | ink_assert(cnt_fld_constructed <= cnt_constructed); |
| 104 | |
| 105 | // init all extendible memory to 0, in case constructors don't |
| 106 | memset(reinterpret_cast<void *>(ext_loc), 0, alloc_size); |
| 107 | |
| 108 | for (auto const &elm : fields) { |
| 109 | if (elm.second.constructor) { |
| 110 | elm.second.constructor(FieldPtr(ext_loc + elm.second.field_offset)); |
| 111 | } |
| 112 | } |
| 113 | } |
| 114 | |
| 115 | void |
| 116 | Schema::callDestructor(uintptr_t ext_loc) |