C UDR returns mi_double_precision I want to run a C UDR that returns CDOUBLETYPE (mi_double_precision).
As far as I understood from the guide, the function cannot return
mi_double_precision by value, the only one option - by reference.
Following this constraint, I allocate a portion of memory with
mi_alloc and return the pointer.
The performance of the function is dramatically low! My assuming -
because of allocation.
Another option is to keep static variable and re-use it, but avoid
parallel execution of the function - also undesirable.
Is there alternative approach? Is it possible to avoid allocation? |