Rev 1892 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1892 | Rev 3959 | ||
---|---|---|---|
Line 38... | Line 38... | ||
38 | #define CAIRO_FREED_POOL_H |
38 | #define CAIRO_FREED_POOL_H |
Line 39... | Line 39... | ||
39 | 39 | ||
40 | #include "cairoint.h" |
40 | #include "cairoint.h" |
Line -... | Line 41... | ||
- | 41 | #include "cairo-atomic-private.h" |
|
- | 42 | ||
- | 43 | CAIRO_BEGIN_DECLS |
|
- | 44 | ||
41 | #include "cairo-atomic-private.h" |
45 | #define DISABLE_FREED_POOLS 0 |
42 | 46 | ||
43 | #if HAS_ATOMIC_OPS |
47 | #if HAS_ATOMIC_OPS && ! DISABLE_FREED_POOLS |
44 | /* Keep a stash of recently freed clip_paths, since we need to |
48 | /* Keep a stash of recently freed clip_paths, since we need to |
45 | * reallocate them frequently. |
49 | * reallocate them frequently. |
46 | */ |
50 | */ |
47 | #define MAX_FREED_POOL_SIZE 4 |
51 | #define MAX_FREED_POOL_SIZE 16 |
48 | typedef struct { |
52 | typedef struct { |
49 | void *pool[MAX_FREED_POOL_SIZE]; |
53 | void *pool[MAX_FREED_POOL_SIZE]; |
Line 116... | Line 120... | ||
116 | 120 | ||
Line 117... | Line 121... | ||
117 | #define HAS_FREED_POOL 1 |
121 | #define HAS_FREED_POOL 1 |
Line -... | Line 122... | ||
- | 122 | ||
- | 123 | #else |
|
- | 124 | ||
- | 125 | /* A warning about an unused freed-pool in a build without atomics |
|
118 | 126 | * enabled usually indicates a missing _freed_pool_reset() in the |
|
Line 119... | Line 127... | ||
119 | #else |
127 | * static reset function */ |
120 | 128 | ||
121 | typedef int freed_pool_t; |
129 | typedef int freed_pool_t; |
Line 122... | Line 130... | ||
122 | 130 | ||
Line -... | Line 131... | ||
- | 131 | #define _freed_pool_get(pool) NULL |
|
- | 132 | #define _freed_pool_put(pool, ptr) free(ptr) |
|
123 | #define _freed_pool_get(pool) NULL |
133 | #define _freed_pool_reset(ptr) |