Function kdb_c_api::decrement_reference_count[][src]

pub fn decrement_reference_count(qobject: K) -> V
Expand description

Decrement reference count of the q object. The decrement must be done when k function gets an error object whose type is qtype::ERROR and when you created an object but do not intend to return it to q side. See details on the reference page.

Example

use kdb_c_api::*;
 
#[no_mangle]
pub extern "C" fn agriculture(_: K)->K{
  // Produce an apple.
  let fruit=new_symbol("apple");
  // Sow the apple seed.
  decrement_reference_count(fruit);
  // Return null.
  KNULL
}
q)do_something: libc_api_examples 2: (`agriculture; 1);
q)do_something[]
q)