node-addon-layer
C API For writing Node modules
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Typedefs | Functions
Persistent methods

Typedefs

typedef void(* shim_weak_cb )(shim_val_t *, void *)
 

Functions

shim_val_tshim_persistent_new (shim_ctx_t *ctx, shim_val_t *val)
 
void shim_persistent_dispose (shim_val_t *val)
 
void shim_obj_make_weak (shim_ctx_t *ctx, shim_val_t *val, void *data, shim_weak_cb cb)
 
void shim_obj_clear_weak (shim_val_t *val)
 

Detailed Description

Methods for persistents

Typedef Documentation

typedef void(* shim_weak_cb)(shim_val_t *, void *)

Callback fired when a peristent is about to be collected

Function Documentation

void shim_obj_clear_weak ( shim_val_t val)

Make a persistent object strong

Parameters
valThe given persistent
void shim_obj_make_weak ( shim_ctx_t ctx,
shim_val_t val,
void *  data,
shim_weak_cb  weak_cb 
)

Make a persistent value weak

Parameters
ctxCurrently executing context
valPersistent to make weak
dataArbitrary data to pass to the weak_cb
weak_cbCallback that will be called when the object is about to be free
void shim_persistent_dispose ( shim_val_t val)

Dispose a perisstent value

Parameters
valThe persistent to dispose
shim_val_t* shim_persistent_new ( shim_ctx_t ctx,
shim_val_t val 
)

Make an existing value persistent

Parameters
ctxThe currently executing context
valThe the given object
Returns
The created persistent