~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to src/3rdparty/webkit/WebCore/platform/Arena.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2009-11-02 18:30:08 UTC
  • mfrom: (1.2.2 upstream)
  • mto: (15.2.5 experimental)
  • mto: This revision was merged to the branch mainline in revision 88.
  • Revision ID: james.westby@ubuntu.com-20091102183008-b6a4gcs128mvfb3m
Tags: upstream-4.6.0~beta1
ImportĀ upstreamĀ versionĀ 4.6.0~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
195
195
    }
196
196
} /* --- end ArenaAllocate() --- */
197
197
 
198
 
void* ArenaGrow(ArenaPool *pool, void *p, unsigned int size, unsigned int incr)
199
 
{
200
 
    void *newp;
201
 
 
202
 
    ARENA_ALLOCATE(newp, pool, size + incr);
203
 
    if (newp)
204
 
        memcpy(newp, p, size);
205
 
    return newp;
206
 
}
207
 
 
208
198
/*
209
199
 * Free tail arenas linked after head, which may not be the true list head.
210
200
 * Reset pool->current to point to head in case it pointed at a tail arena.
255
245
    pool->current = head;
256
246
}
257
247
 
258
 
void ArenaRelease(ArenaPool *pool, char *mark)
259
 
{
260
 
    Arena *a;
261
 
 
262
 
    for (a = pool->first.next; a; a = a->next) {
263
 
        if (UPTRDIFF(mark, a->base) < UPTRDIFF(a->avail, a->base)) {
264
 
            a->avail = (uword)ARENA_ALIGN(pool, mark);
265
 
            FreeArenaList(pool, a, false);
266
 
            return;
267
 
        }
268
 
    }
269
 
}
270
 
 
271
248
void FreeArenaPool(ArenaPool *pool)
272
249
{
273
250
    FreeArenaList(pool, &pool->first, false);