~ubuntu-branches/ubuntu/wily/qtdeclarative-opensource-src/wily-proposed

« back to all changes in this revision

Viewing changes to src/qml/parser/qqmljsmemorypool_p.h

  • Committer: Package Import Robot
  • Author(s): Ricardo Salveti de Araujo, Ricardo Salveti de Araujo, Timo Jyrinki
  • Date: 2014-06-19 02:39:21 UTC
  • mfrom: (0.1.18 experimental)
  • Revision ID: package-import@ubuntu.com-20140619023921-yb2oasnuetz9b0fc
Tags: 5.3.0-3ubuntu4
[ Ricardo Salveti de Araujo ]
* debian/control:
  - Updating dependencies as we now also have libqt5quickwidgets5-gles
* libqt5quickwidgets5.symbols: updating to allow gles variant

[ Timo Jyrinki ]
* Update libqt5quickparticles5.symbols from build logs

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
 
66
66
namespace QQmlJS {
67
67
 
 
68
class Managed;
 
69
 
68
70
class QML_PARSER_EXPORT MemoryPool : public QSharedData
69
71
{
70
72
    MemoryPool(const MemoryPool &other);
108
110
        _ptr = _end = 0;
109
111
    }
110
112
 
 
113
    template <typename _Tp> _Tp *New() { return new (this->allocate(sizeof(_Tp))) _Tp(); }
 
114
 
 
115
    template <typename PoolContentType, typename Visitor>
 
116
    void visitManagedPool(Visitor &visitor)
 
117
    {
 
118
        for (int i = 0; i <= _blockCount; ++i) {
 
119
            char *p = _blocks[i];
 
120
            char *end = p + BLOCK_SIZE;
 
121
            if (i == _blockCount) {
 
122
                Q_ASSERT(_ptr <= end);
 
123
                end = _ptr;
 
124
            }
 
125
 
 
126
            Q_ASSERT(p <= end);
 
127
 
 
128
            const qptrdiff increment = (sizeof(PoolContentType) + 7) & ~7;
 
129
 
 
130
            while (p + increment <= end) {
 
131
                visitor(reinterpret_cast<PoolContentType*>(p));
 
132
                p += increment;
 
133
            }
 
134
        }
 
135
    }
 
136
 
111
137
private:
112
138
    void *allocate_helper(size_t size)
113
139
    {