2
#include "simple_list.h"
13
for ( log2 = 1 ; n > 1 ; log2++ ) {
20
static void calculate_heap_size( driTexHeap * heap, unsigned size,
21
unsigned nr_regions, unsigned alignmentShift )
25
l = driLog2( (size - 1) / nr_regions );
26
if ( l < alignmentShift )
31
heap->logGranularity = l;
32
heap->size = size & ~((1L << l) - 1);
37
intel_driReinitTextureHeap( driTexHeap *heap,
40
driTextureObject *t, *tmp;
42
/* Kick out everything:
44
foreach_s ( t, tmp, & heap->texture_objects ) {
45
if ( t->tObj != NULL ) {
46
driSwapOutTextureObject( t );
49
driDestroyTextureObject( t );
53
/* Destroy the memory manager:
55
mmDestroy( heap->memory_heap );
57
/* Recreate the memory manager:
59
calculate_heap_size(heap, size, heap->nrRegions, heap->alignmentShift);
60
heap->memory_heap = mmInit( 0, heap->size );
61
if ( heap->memory_heap == NULL ) {
62
fprintf(stderr, "driReinitTextureHeap: couldn't recreate memory heap\n");
67
make_empty_list( & heap->texture_objects );