summaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2010-06-06 16:04:42 -0700
committerKeith Packard <keithp@keithp.com>2010-06-06 16:22:12 -0700
commitf03be727d647183a2176355ad0ac9a6735067be9 (patch)
tree02a7d96e3bafec5a116fef6e774e4c3ebc167238 /render
parent67b824a81bb8254827023de351a4a094031f0e94 (diff)
Place glyph privates at correct location within the allocate storage
A glyph allocation consists of : GlyphRec numScreens * PicturePtr glyph privates Tell the dix private bits to start past the picture pointers. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'render')
-rw-r--r--render/glyph.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/render/glyph.c b/render/glyph.c
index 948a20a9a..7193d4763 100644
--- a/render/glyph.c
+++ b/render/glyph.c
@@ -368,8 +368,6 @@ FindGlyph (GlyphSetPtr glyphSet, Glyph id)
return glyph;
}
-#define GLYPH_SIZE (sizeof (GlyphRec) + dixPrivatesSize(PRIVATE_GLYPH))
-
GlyphPtr
AllocateGlyph (xGlyphInfo *gi, int fdepth)
{
@@ -377,15 +375,17 @@ AllocateGlyph (xGlyphInfo *gi, int fdepth)
int size;
GlyphPtr glyph;
int i;
+ int head_size;
- size = screenInfo.numScreens * sizeof (PicturePtr);
- glyph = (GlyphPtr) malloc (size + GLYPH_SIZE);
+ head_size = sizeof (GlyphRec) + screenInfo.numScreens * sizeof (PicturePtr);
+ size = (head_size + dixPrivatesSize(PRIVATE_GLYPH));
+ glyph = (GlyphPtr) malloc (size);
if (!glyph)
return 0;
glyph->refcnt = 0;
glyph->size = size + sizeof (xGlyphInfo);
glyph->info = *gi;
- dixInitPrivates(glyph, glyph + 1, PRIVATE_GLYPH);
+ dixInitPrivates(glyph, (char *) glyph + head_size, PRIVATE_GLYPH);
for (i = 0; i < screenInfo.numScreens; i++)
{