Conversation
|
PR Verification: ❌ failure |
| void | ||
| _DML_free_qname_cache(qname_cache_t *cache) | ||
| { | ||
| for (int i = 0; i < 4; i++) { |
There was a problem hiding this comment.
Can this magic 4 be a define?
There was a problem hiding this comment.
sizeof(cache->bufs)/sizeof(cache->bufs[0]) is also a pretty common C pattern (though typically broken out to a macro)
There was a problem hiding this comment.
That works for me too, I wasn't sure if cache->bufs was an array or pointer
lwaern-intel
left a comment
There was a problem hiding this comment.
There's a potential pitfall, here; model code can be called following _destroy due to immediate after (see c_backend.generate_deinit,) and that model code could call _qname and reallocate the buffers.
The surefire way to address that is to free the qname cache separately from _destroy. Say, introduce the method _destroy_qname_cache and then codegen_inline_byname it in generate_deinit after the final _DML_execute_immediate_afters_now. Or we could just be fine with that extremely unlikely leak.
| void | ||
| _DML_free_qname_cache(qname_cache_t *cache) | ||
| { | ||
| for (int i = 0; i < 4; i++) { |
There was a problem hiding this comment.
sizeof(cache->bufs)/sizeof(cache->bufs[0]) is also a pretty common C pattern (though typically broken out to a macro)
| method _destroy() { _rec_destroy(); } | ||
| method _destroy() { | ||
| _rec_destroy(); | ||
| _DML_free_qname_cache(); |
There was a problem hiding this comment.
Missing its argument.
No description provided.