p2  0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PNWeakRef Struct Reference

a weak ref is used for upvals, it acts as a memory slot, non-volatile but mutable. More...

#include <potion.h>

Public Member Functions

PN potion_ref (Potion *P, PN data)
 
PN potion_ref_string (Potion *P, PN cl, PN self, PN len)
 
#define PN_DEREF(x)   ((struct PNWeakRef *)(x))->data
 

Data Fields

 PN_OBJECT_HEADER
 PNType vt; PNUniq uniq. More...
 
PN data
 

Detailed Description

a weak ref is used for upvals, it acts as a memory slot, non-volatile but mutable.

Definition at line 488 of file potion.h.

Member Function Documentation

PN potion_ref ( Potion P,
PN  data 
)

PNWeakRef constructor, get or set the attached ref data

Parameters
data- non-volatile but mutable
Returns
if is_ref data returns data, else create and return a new PNWeakRef to data

Definition at line 473 of file objmodel.c.

PN potion_ref_string ( Potion P,
PN  cl,
PN  self,
PN  len 
)

"string" of a ref, a PNWeakRef object

Returns
"\<ref>"

Definition at line 483 of file objmodel.c.

Field Documentation

PNWeakRef::PN_OBJECT_HEADER

PNType vt; PNUniq uniq.

Definition at line 489 of file potion.h.

PN PNWeakRef::data

Definition at line 490 of file potion.h.


The documentation for this struct was generated from the following files: