~zorba-coders/zorba/QT_driver_fixes

« back to all changes in this revision

Viewing changes to src/store/naive/item.cpp

  • Committer: sorin.marian.nasoi
  • Date: 2013-08-06 16:39:51 UTC
  • mfrom: (11547.2.36 lp_zorba)
  • Revision ID: spungi@gmail.com-20130806163951-ad2k2v2914sbqr3f
-merged lp:zorba trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
 
49
49
void Item::addReference() const
50
50
{
51
 
#if defined WIN32 && !defined CYGWIN && !defined ZORBA_FOR_ONE_THREAD_ONLY
52
 
  if (isNode())
53
 
  {
54
 
    InterlockedIncrement(theUnion.treeRCPtr);
55
 
    InterlockedIncrement(&theRefCount);
56
 
  }
57
 
  else
58
 
  {
59
 
    InterlockedIncrement(&theRefCount);
60
 
  }
61
 
 
62
 
#else
63
 
 
64
51
  switch (getKind())
65
52
  {
66
53
  case NODE:
111
98
    ZORBA_ASSERT(false);
112
99
  }  
113
100
  }
114
 
#endif
115
101
}
116
102
 
117
103
 
231
217
}
232
218
 
233
219
 
 
220
long Item::getRefCount() const
 
221
{
 
222
  long refCount;
 
223
 
 
224
  switch (getKind())
 
225
  {
 
226
  case ATOMIC:
 
227
  {
 
228
    SYNC_CODE(static_cast<const simplestore::AtomicItem*>(this)->getRCLock()->acquire());
 
229
    refCount = theRefCount;
 
230
    SYNC_CODE(static_cast<const simplestore::AtomicItem*>(this)->getRCLock()->release());
 
231
    return refCount;
 
232
  }
 
233
  case NODE:
 
234
  case OBJECT:
 
235
  case ARRAY:
 
236
  case ERROR_:
 
237
  case LIST:
 
238
  case FUNCTION:
 
239
  case PUL:
 
240
  default:
 
241
  {
 
242
    ZORBA_ASSERT(false);
 
243
  }
 
244
  }
 
245
 
 
246
  return refCount;
 
247
}
 
248
 
 
249
 
234
250
size_t Item::alloc_size() const
235
251
{
236
252
  return 0;