[cairoint] Define CAIRO_STACK_BUFFER_SIZE (defaults to 2kb)

This is the suggested size in bytes of buffers allocated on the stack per
function, mostly used for glyph rendering.  We typically use a local buffer on
the stack to avoid mallocing for small requests.  Requests that do not fit are
malloc()ed automatically.  The default value should be enough for about a
100-glyph cairo_show_glyphs() operation.
This commit is contained in:
Behdad Esfahbod 2006-12-11 03:10:05 -05:00
parent 5a9642c574
commit da60bc45f2

View file

@ -208,6 +208,13 @@ cairo_private void _cairo_beos_unlock(void*);
#define M_PI 3.14159265358979323846
#endif
/* Size in bytes of buffer to use off the stack per functions.
* Mostly used by text functions. For larger allocations, they'll
* malloc(). */
#ifndef CAIRO_STACK_BUFFER_SIZE
#define CAIRO_STACK_BUFFER_SIZE (512 * sizeof (int))
#endif
#define ASSERT_NOT_REACHED \
do { \
static const int NOT_REACHED = 0; \