source: git/Singular/countedref.cc @ 8357e21

spielwiese
Last change on this file since 8357e21 was 3aa7f9, checked in by Alexander Dreyer <alexander.dreyer@…>, 12 years ago
Allow for explicitly derefercing of lists
  • Property mode set to 100644
File size: 20.6 KB
Line 
1// -*- c++ -*-
2//*****************************************************************************
3/** @file countedref.cc
4 *
5 * @author Alexander Dreyer
6 * @date 2012-08-15
7 *
8 * This file defines reference countes interpreter objects and adds the
9 * @c blackbox operations for high-level types 'reference' and 'shared'.
10 *
11 * @note This works was supported by the "Industrial Algebra" project.
12 *
13 * @par Copyright:
14 *   (c) 2012 by The Singular Team, see LICENSE file
15**/
16//*****************************************************************************
17
18
19#include "mod2.h"
20#include "ipid.h"
21
22#include "countedref.h"
23
24#include "blackbox.h"
25#include "newstruct.h"
26#include "ipshell.h"
27
28class CountedRefEnv {
29  typedef CountedRefEnv self;
30
31public:
32
33  static int& ref_id() {
34    static int g_ref_id = 0;
35    return g_ref_id;
36  }
37
38  static int& sh_id() {
39    static int g_sh_id = 0;
40    return g_sh_id;
41  }
42};
43
44/// Overloading ring destruction
45inline void CountedRefPtr_kill(ring r) { rKill(r); }
46
47
48/** @class CountedRefData
49 * This class stores a reference counter as well as a Singular interpreter object.
50 * It also take care of the context, e.g. the current ring, wrap object, etc.
51 **/
52class CountedRefData:
53  public RefCounter {
54  typedef CountedRefData self;
55public:
56  typedef CountedRefWeakPtr<self*> back_ptr;
57private:
58  typedef RefCounter base;
59
60  /// Generate object linked to other reference (e.g. for subscripts)
61  CountedRefData(leftv wrapid, back_ptr back):
62    base(), m_data(wrapid), m_ring(back->m_ring), m_back(back) {
63  }
64
65  /// @name Disallow copying to avoid inconsistence
66  //@{
67  self& operator=(const self&);
68  CountedRefData(const self&);
69  //@}
70
71public:
72  typedef LeftvDeep::copy_tag copy_tag;
73
74  /// Fix smart pointer type to referenced data
75  typedef back_ptr::ptr_type ptr_type;
76
77  /// Fix smart pointer type to ring
78  typedef CountedRefPtr<ring, true> ring_ptr;
79
80  /// Construct shared memory empty Singular object
81  explicit CountedRefData():
82    base(), m_data(), m_ring(), m_back() { }
83
84  /// Reference Singular object
85  explicit CountedRefData(leftv data):
86    base(), m_data(data), m_ring(parent(data)), m_back() { }
87
88  /// Construct reference for Singular object
89  CountedRefData(leftv data, copy_tag do_copy):
90    base(), m_data(data, do_copy), m_ring(parent(data)), m_back() { }
91
92  /// Destruct
93  ~CountedRefData() {
94    if (!m_back.unassigned()) {
95      if (m_back == this)
96        m_back.invalidate();
97      else
98        m_data.clearid(root()); 
99    }
100  }
101
102  /// Generate object for indexing
103  ptr_type wrapid() { return new self(m_data.idify(root()), weakref()); }
104
105  /// Gerenate  weak (but managed) reference to @c *this
106  back_ptr weakref() {
107    if (m_back.unassigned()) 
108      m_back = this;
109    return m_back;
110  }
111  /// Replace with other Singular data
112  self& operator=(leftv rhs) {
113    m_data = rhs;
114    m_ring = parent(rhs);
115    return *this;
116  }
117
118  /// Write (shallow) copy to given handle
119  BOOLEAN put(leftv res) { return broken() || m_data.put(res);  }
120
121  /// Extract (shallow) copy of stored data
122  LeftvShallow operator*() const { return (broken()? LeftvShallow(): (const LeftvShallow&)m_data); }
123
124  /// Determine active ring when ring dependency changes
125  BOOLEAN rering() {
126    if (m_ring ^ m_data.ringed()) m_ring = (m_ring? NULL: currRing);
127    return (m_back && (m_back != this) && m_back->rering());
128  }
129
130  /// Get the current context
131  idhdl* root() { return  (m_ring? &m_ring->idroot: &IDROOT); }
132
133  /// Check whether identifier became invalid
134  BOOLEAN broken() const {
135    if (!m_back.unassigned() && !m_back) 
136      return complain("Back-reference broken");   
137
138    if (m_ring) {
139      if (m_ring != currRing) 
140        return complain("Referenced identifier not from current ring");   
141
142      return m_data.isid()  && m_data.brokenid(currRing->idroot) &&
143        complain("Referenced identifier not available in ring anymore"); 
144    }
145   
146    if (!m_data.isid()) return FALSE;
147    return  m_data.brokenid(IDROOT) &&
148     ((currPack == basePack) ||  m_data.brokenid(basePack->idroot)) &&
149     complain("Referenced identifier not available in current context");
150  }
151
152  /// Reassign actual object
153  BOOLEAN assign(leftv result, leftv arg) { 
154
155    if (!m_data.isid()) {
156      (*this) = arg;
157      return FALSE;
158    }
159    return put(result) || iiAssign(result, arg) || rering();
160  }
161  /// Recover additional information (e.g. subexpression) from likewise object
162  BOOLEAN retrieve(leftv res) { return m_data.retrieve(res); }
163
164  /// Check whether data is all-zero
165  BOOLEAN unassigned() const { return m_data.unassigned(); }
166
167private:
168  /// Raise error message and return @c TRUE
169  BOOLEAN complain(const char* text) const  {
170    Werror(text);
171    return TRUE;
172  }
173
174  /// Store ring for ring-dependent objects
175  static ring parent(leftv rhs) { 
176    return (rhs->RingDependend()? currRing: NULL); 
177  }
178
179protected:
180  /// Singular object
181  LeftvDeep m_data;
182
183  /// Store namespace for ring-dependent objects
184  ring_ptr m_ring;
185
186  /// Reference to actual object for wrap structures 
187  back_ptr m_back;
188};
189
190/// Supporting smart pointer @c CountedRefPtr
191inline void CountedRefPtr_kill(CountedRefData* data) { delete data; }
192
193
194/// blackbox support - initialization
195void* countedref_Init(blackbox*)
196{
197  return NULL;
198}
199
200
201class CountedRef {
202  typedef CountedRef self;
203
204public:
205  /// name type for identifiers
206  typedef int id_type;
207
208  /// Name type for handling referenced data
209  typedef CountedRefData data_type;
210
211  /// Fix smart pointer type to referenced data
212  typedef CountedRefPtr<CountedRefData*> data_ptr;
213
214  /// Check whether argument is already a reference type
215  static BOOLEAN is_ref(leftv arg) {
216    int typ = arg->Typ();
217    return ((typ==CountedRefEnv::ref_id())  ||(typ==CountedRefEnv::sh_id()) );
218    //    return ((typ > MAX_TOK) &&
219    //            (getBlackboxStuff(typ)->blackbox_Init == countedref_Init));
220  }
221
222  /// Reference given Singular data 
223  explicit CountedRef(leftv arg):  m_data(new data_type(arg)) { }
224
225protected:
226  /// Recover previously constructed reference
227  CountedRef(data_ptr arg):  m_data(arg) { assume(arg); }
228
229public:
230  /// Construct copy
231  CountedRef(const self& rhs): m_data(rhs.m_data) { }
232
233  /// Replace reference
234  self& operator=(const self& rhs) {
235    m_data = rhs.m_data;
236    return *this;
237  }
238
239  BOOLEAN assign(leftv result, leftv arg) {
240    return m_data->assign(result,arg);
241  }
242
243  /// Extract (shallow) copy of stored data
244  LeftvShallow operator*() { return m_data->operator*(); }
245
246  /// Construct reference data object marked by given identifier number
247  BOOLEAN outcast(leftv res, int typ) {
248    res->rtyp = typ;
249    return outcast(res);
250  }
251
252  /// Construct reference data object from *this
253  BOOLEAN outcast(leftv res) {
254    if (res->rtyp == IDHDL)
255      IDDATA((idhdl)res->data) = (char *)outcast();
256    else
257      res->data = (void *)outcast();
258    return FALSE;
259  }
260
261  /// Construct raw reference data
262  data_type* outcast() { 
263    m_data.reclaim();
264    return m_data;
265  }
266
267  /// Kills a link to the referenced object
268  void destruct() { m_data.release(); }
269
270  /// Kills the link to the referenced object
271  ~CountedRef() { }
272
273  /// Replaces argument by a shallow copy of the references data
274  BOOLEAN dereference(leftv arg) {
275    m_data.reclaim();
276    BOOLEAN b= m_data->put(arg) || ((arg->next != NULL) && resolve(arg->next));
277    m_data.release();
278    return b;
279  }
280
281  /// Check whether object in valid in current context
282  BOOLEAN broken() {return m_data->broken(); }
283
284  /// Check whether (shared) data was initialized but not assigned yet.
285  BOOLEAN unassigned() const { return m_data->unassigned(); }
286
287  /// Get number of references pointing here, too
288  BOOLEAN count(leftv res) { return construct(res, m_data.count() - 1); }
289
290  // Get internal indentifier
291  BOOLEAN enumerate(leftv res) { return construct(res, (long)(data_type*)m_data); }
292
293  /// Check for likewise identifiers
294  BOOLEAN likewise(leftv res, leftv arg) {
295    return resolve(arg) || construct(res, operator*()->data == arg->data); 
296  }
297
298  /// Check for identical reference objects
299  BOOLEAN same(leftv res, leftv arg) { 
300    return construct(res, m_data == arg->Data());
301  }
302
303  /// Get type of references data
304  BOOLEAN type(leftv res) { 
305    return construct(res, Tok2Cmdname(operator*()->Typ()));
306  };
307
308  /// Get (possibly) internal identifier name
309  BOOLEAN name(leftv res) { return construct(res, operator*()->Name()); }
310
311  /// Recover the actual object from raw Singular data
312  static self cast(void* data) {
313    assume(data != NULL);
314    return self(static_cast<data_type*>(data));
315  }
316
317  /// Recover the actual object from Singular interpreter object
318  static self cast(leftv arg) {
319    assume(arg != NULL); assume(is_ref(arg));
320    return self::cast(arg->Data());
321  }
322
323  /// If necessary dereference.
324  static BOOLEAN resolve(leftv arg) {
325    assume(arg != NULL);
326    while (is_ref(arg)) { if(CountedRef::cast(arg).dereference(arg)) return TRUE; };
327    return (arg->next != NULL) && resolve(arg->next);
328  }
329
330  /// Construct integer value
331  static BOOLEAN construct(leftv res, long data) {
332    res->data = (void*) data;
333    res->rtyp = INT_CMD;
334    return FALSE;
335  }
336
337  /// Construct string
338  static BOOLEAN construct(leftv res, const char* data) {
339    res->data = (void*)omStrDup(data);
340    res->rtyp = STRING_CMD;
341    return FALSE;
342  }
343  /// Construct void-style object
344  static BOOLEAN construct(leftv res) {
345    res->data = NULL;
346    res->rtyp = NONE;
347    return FALSE;
348  }
349
350protected:
351  /// Store pointer to actual data
352  data_ptr m_data;
353};
354
355/// blackbox support - convert to string representation
356void countedref_Print(blackbox *b, void* ptr)
357{
358  if (ptr) (*CountedRef::cast(ptr))->Print();
359  else PrintS("<unassigned reference or shared memory>");
360}
361
362/// blackbox support - convert to string representation
363char* countedref_String(blackbox *b, void* ptr)
364{
365  if (ptr == NULL) return omStrDup(sNoName);
366  return (*CountedRef::cast(ptr))->String();
367}
368
369/// blackbox support - copy element
370void* countedref_Copy(blackbox*b, void* ptr)
371{ 
372  if (ptr) return CountedRef::cast(ptr).outcast();
373  return NULL;
374}
375
376/// blackbox support - assign element
377BOOLEAN countedref_Assign(leftv result, leftv arg)
378{
379  // Case: replace assignment behind reference
380  if (result->Data() != NULL) {
381    CountedRef ref = CountedRef::cast(result);
382    return CountedRef::resolve(arg) || ref.assign(result, arg); 
383  }
384 
385  // Case: copy reference
386  if (result->Typ() == arg->Typ())
387    return CountedRef::cast(arg).outcast(result);
388
389  // Case: new reference
390  if ((arg->rtyp == IDHDL) || CountedRef::is_ref(arg))
391    return CountedRef(arg).outcast(result);
392
393  Werror("Can only take reference from identifier");
394  return TRUE;
395}
396
397BOOLEAN countedref_CheckInit(leftv res, leftv arg)
398{
399  if (arg->Data() != NULL) return FALSE;
400  res->rtyp = NONE;
401  Werror("Noninitialized access");
402  return TRUE;
403}
404                                                                 
405/// blackbox support - unary operations
406BOOLEAN countedref_Op1(int op, leftv res, leftv head)
407{
408  if(op == TYPEOF_CMD)
409    return blackboxDefaultOp1(op, res, head);
410
411  if (countedref_CheckInit(res, head)) return TRUE;
412 
413  if ((op == DEF_CMD) || (op == head->Typ())) {
414    res->rtyp = head->Typ();
415    return iiAssign(res, head);
416  }
417
418  CountedRef ref = CountedRef::cast(head);
419  return ref.dereference(head) ||
420    iiExprArith1(res, head, op == LINK_CMD? head->Typ(): op);
421}
422
423
424
425/// blackbox support - binary operations (resolve seocnd argument)
426static BOOLEAN countedref_Op2_(int op, leftv res, leftv head, leftv arg)
427{
428  if (CountedRef::is_ref(arg)) {
429    CountedRef ref = CountedRef::cast(arg);
430    return ref.dereference(arg) || iiExprArith2(res, head, op, arg);
431  }
432  return  iiExprArith2(res, head, op, arg);
433}
434
435BOOLEAN countedref_Op2(int op, leftv res, leftv head, leftv arg)
436{
437  if (countedref_CheckInit(res, head)) return TRUE;
438  if (CountedRef::is_ref(head)) {
439    CountedRef ref = CountedRef::cast(head);
440    return ref.dereference(head) || countedref_Op2_(op, res, head, arg);
441  }
442  return countedref_Op2_(op, res, head, arg);
443}
444
445static BOOLEAN countedref_Op3__(int op, leftv res, leftv head, leftv arg1, leftv arg2)
446{
447
448  if (CountedRef::is_ref(arg2)) {
449    CountedRef ref = CountedRef::cast(arg2);
450    return ref.dereference(arg2) || iiExprArith3(res, op, head, arg1, arg2);
451  }
452  return iiExprArith3(res, op, head, arg1, arg2);
453}
454
455static BOOLEAN countedref_Op3_(int op, leftv res, leftv head, leftv arg1, leftv arg2)
456{
457  if (CountedRef::is_ref(arg1)) {
458    CountedRef ref = CountedRef::cast(arg1);
459    return ref.dereference(arg1) || countedref_Op3__(op, res, head, arg1, arg2);
460  }
461  return countedref_Op3__(op, res, head, arg1, arg2);
462}
463
464
465/// blackbox support - ternary operations
466BOOLEAN countedref_Op3(int op, leftv res, leftv head, leftv arg1, leftv arg2)
467{
468  if (countedref_CheckInit(res, head)) return TRUE;
469  if (CountedRef::is_ref(head)) {
470    CountedRef ref = CountedRef::cast(head);
471    return ref.dereference(head) || countedref_Op3_(op, res, head, arg1, arg2);
472  }
473  return countedref_Op3_(op, res, head, arg1, arg2);
474}
475
476
477/// blackbox support - destruction
478void countedref_destroy(blackbox *b, void* ptr)
479{
480  if (ptr) CountedRef::cast(ptr).destruct();
481}
482
483
484class CountedRefShared:
485  public CountedRef {
486  typedef CountedRefShared self;
487  typedef CountedRef base;
488
489  /// Reinterprete @c CountedRef as @c CountedRefShared
490  CountedRefShared(const base& rhs):  base(rhs) { }
491
492  /// Generate from data pointer
493  CountedRefShared(data_ptr rhs):  base(rhs) { }
494
495public:
496  /// Default constructor for initialized, but all-zero, shared data object
497  CountedRefShared():  base(new data_type) { }
498
499  /// Construct internal copy of Singular interpreter object
500  explicit CountedRefShared(leftv arg):  base(new data_type(arg, data_type::copy_tag())) { }
501
502  /// Construct new reference to internal data
503  CountedRefShared(const self& rhs): base(rhs) { }
504
505  /// Desctruct
506  ~CountedRefShared() { }
507
508  /// Change reference to shared data
509  self& operator=(const self& rhs) {
510    return static_cast<self&>(base::operator=(rhs));
511  }
512
513  /// Recovering outcasted @c CountedRefShared object from interpreter object
514  static self cast(leftv arg) { return base::cast(arg); }
515
516  /// Recovering outcasted @c CountedRefShared object from raw data
517  static self cast(void* arg) { return base::cast(arg); }
518
519  /// Temporarily wrap with identifier for '[' and '.' operation
520  self wrapid() { return self(m_data->wrapid()); }
521
522  /// Generate weak reference (may get invalid)
523  data_type::back_ptr weakref() { return m_data->weakref(); }
524
525  /// Recover more information (e.g. subexpression data) from computed result
526  BOOLEAN retrieve(leftv res, int typ) { 
527    return (m_data->retrieve(res) && outcast(res, typ));
528  }
529};
530
531/// Blackbox support - generate initialized, but all-zero - shared data
532void* countedref_InitShared(blackbox*)
533{
534  return CountedRefShared().outcast();
535}
536
537/// Blackbox support - unary operation for shared data
538BOOLEAN countedref_Op1Shared(int op, leftv res, leftv head)
539{
540  if(op == TYPEOF_CMD)
541    return blackboxDefaultOp1(op, res, head);
542
543  if (countedref_CheckInit(res, head)) return TRUE;
544
545  if ((op == DEF_CMD) || (op == head->Typ())) {
546    res->rtyp = head->Typ();
547    return iiAssign(res, head);
548  }
549
550  CountedRefShared ref = CountedRefShared::cast(head);
551
552  if ((op == LINK_CMD) ) {
553    if (ref.dereference(head)) return TRUE;
554    res->Copy(head);
555    return (res->Typ() == NONE);
556  }
557
558  CountedRefShared wrap = ref.wrapid();
559  int typ = head->Typ();
560  return wrap.dereference(head) || iiExprArith1(res, head, op) ||
561    wrap.retrieve(res, typ);
562}
563
564
565/// blackbox support - binary operations
566BOOLEAN countedref_Op2Shared(int op, leftv res, leftv head, leftv arg)
567{
568  if (countedref_CheckInit(res, head))  return TRUE;
569
570  if (CountedRefShared::is_ref(head)) {
571    CountedRefShared wrap = CountedRefShared::cast(head).wrapid();
572    int typ = head->Typ();
573    return wrap.dereference(head) || countedref_Op2_(op, res, head, arg) ||
574      wrap.retrieve(res, typ);
575  }
576
577  return countedref_Op2_(op, res, head, arg);
578}
579
580/// blackbox support - n-ary operations
581BOOLEAN countedref_OpM(int op, leftv res, leftv args)
582{
583  if (args->Data() == NULL) return FALSE;
584
585  if(op == SYSTEM_CMD) {
586    if (args->next) {
587      leftv next = args->next;
588      args->next = NULL;
589
590      char* name = (next->Typ() == STRING_CMD? 
591                    (char*) next->Data(): (char*)next->Name());
592      next = next->next;
593
594      if (strcmp(name, "help") == 0) {
595        PrintS("system(<ref>, ...): extended functionality for reference/shared data <ref>\n");
596        PrintS("  system(<ref>, count)         - number of references pointing to <ref>\n");
597        PrintS("  system(<ref>, enumerate)     - unique number for identifying <ref>\n");
598        PrintS("  system(<ref>, undefined)     - checks whether <ref> had been assigned\n");
599        PrintS("  system(<ref>, \"help\")        - prints this information message\n");
600        PrintS("  system(<ref>, \"typeof\")      - actual type referenced by <ref>\n");
601        PrintS("  system(<ref1>, same, <ref2>) - tests for identic reference objects\n");
602        return CountedRef::construct(res);
603      }
604      if (strncmp(name, "undef", 5) == 0) {
605        return CountedRef::construct(res, args->Data()? 
606                          (CountedRef::cast(args).unassigned()? 1: 2): 0);
607      }
608
609      CountedRef obj = CountedRef::cast(args);
610      if (next) {
611        if (strcmp(name, "same") == 0) return obj.same(res, next);
612        // likewise may be hard to interprete, so we not not document it above
613        if (strncmp(name, "like", 4) == 0) return obj.likewise(res, next); 
614      }
615      if (strncmp(name, "count", 5) == 0) return obj.count(res);
616      if (strncmp(name, "enum", 4) == 0) return obj.enumerate(res);
617      if (strcmp(name, "name") == 0) return obj.name(res); // undecumented
618      if (strncmp(name, "typ", 3) == 0) return obj.type(res);
619    }
620    return TRUE;
621  }
622  if (op == LIST_CMD){
623    res->rtyp = op;
624    return jjLIST_PL(res, args);
625  }
626  CountedRef ref = CountedRef::cast(args);
627  return ref.dereference(args) || iiExprArithM(res, args, op);
628}
629
630/// blackbox support - assign element
631BOOLEAN countedref_AssignShared(leftv result, leftv arg)
632{
633  /// Case: replace assignment behind reference
634  if ((result->Data() != NULL)  && !CountedRefShared::cast(result).unassigned()) {
635    CountedRef ref = CountedRef::cast(result);
636    return CountedRef::resolve(arg) || ref.assign(result, arg); 
637  }
638 
639  /// Case: new reference to already shared data
640  if (result->Typ() == arg->Typ()) {
641    if (result->Data() != NULL) 
642      CountedRefShared::cast(result).destruct();
643    return CountedRefShared::cast(arg).outcast(result);
644  } 
645  if(CountedRefShared::cast(result).unassigned()) {
646   return CountedRefShared::cast(result).assign(result, arg);
647
648    return FALSE;
649  }
650   
651  /// Case: new shared data
652  return CountedRefShared(arg).outcast(result);
653}
654
655/// blackbox support - destruction
656void countedref_destroyShared(blackbox *b, void* ptr)
657{
658  if (ptr) CountedRefShared::cast(ptr).destruct();
659}
660
661
662BOOLEAN countedref_serialize(blackbox *b, void *d, si_link f)
663{
664  sleftv l;
665  memset(&l,0,sizeof(l));
666  l.rtyp = STRING_CMD;
667  l.data = (void*)omStrDup("shared"); // references are converted
668  f->m->Write(f, &l);
669  CountedRefShared::cast(d).dereference(&l);
670  f->m->Write(f, &l);
671  return FALSE;
672}
673
674BOOLEAN countedref_deserialize(blackbox **b, void **d, si_link f)
675{
676  // rtyp must be set correctly (to the blackbox id) by routine calling
677  leftv data=f->m->Read(f);
678  CountedRefShared sh(data);
679  *d = sh.outcast();
680  return FALSE;
681}
682
683void countedref_init() 
684{
685  blackbox *bbx = (blackbox*)omAlloc0(sizeof(blackbox));
686  bbx->blackbox_destroy = countedref_destroy;
687  bbx->blackbox_String  = countedref_String;
688  bbx->blackbox_Print  = countedref_Print;
689  bbx->blackbox_Init    = countedref_Init;
690  bbx->blackbox_Copy    = countedref_Copy;
691  bbx->blackbox_Assign  = countedref_Assign;
692  bbx->blackbox_Op1     = countedref_Op1;
693  bbx->blackbox_Op2     = countedref_Op2;
694  bbx->blackbox_Op3     = countedref_Op3;
695  bbx->blackbox_OpM     = countedref_OpM;
696  bbx->blackbox_serialize   = countedref_serialize;
697  bbx->blackbox_deserialize = countedref_deserialize;
698  bbx->data             = omAlloc0(newstruct_desc_size());
699  CountedRefEnv::ref_id()=setBlackboxStuff(bbx, "reference");
700
701  /// The @c shared type is "inherited" from @c reference.
702  /// It just uses another constructor (to make its own copy of the).
703  blackbox *bbxshared = 
704    (blackbox*)memcpy(omAlloc(sizeof(blackbox)), bbx, sizeof(blackbox));
705  bbxshared->blackbox_Assign  = countedref_AssignShared;
706  bbxshared->blackbox_destroy = countedref_destroyShared;
707  bbxshared->blackbox_Op1     = countedref_Op1Shared;
708  bbxshared->blackbox_Op2     = countedref_Op2Shared;
709  bbxshared->blackbox_Init    = countedref_InitShared;
710  bbxshared->data             = omAlloc0(newstruct_desc_size());
711  CountedRefEnv::sh_id()=setBlackboxStuff(bbxshared, "shared");
712}
713
714#ifdef HAVE_DYNAMIC_COUNTEDREF
715extern "C" { void mod_init() { countedref_init(); } }
716#endif
717
Note: See TracBrowser for help on using the repository browser.