cog: Use g_malloc() instead of malloc()

malloc() needs stdlib.h, which isn't included here and the
memory is freed later with g_free() anyway.
This commit is contained in:
Robert Swain 2010-06-27 17:46:44 +02:00 committed by Sebastian Dröge
parent 144d43bcef
commit 960deb823f
2 changed files with 3 additions and 3 deletions

View file

@ -146,7 +146,7 @@ cog_frame_new_and_alloc_extended (CogMemoryDomain * domain,
frame->components[2].v_shift = v_shift;
frame->components[2].h_shift = h_shift;
frame->regions[0] = malloc (frame->components[0].length +
frame->regions[0] = g_malloc (frame->components[0].length +
frame->components[1].length + frame->components[2].length);
frame->components[0].data = COG_OFFSET (frame->regions[0],

View file

@ -52,7 +52,7 @@ cog_frame_new_virtual (CogMemoryDomain * domain, CogFrameFormat format,
frame->components[0].h_shift = 0;
frame->regions[0] =
malloc (frame->components[0].stride * COG_FRAME_CACHE_SIZE);
g_malloc (frame->components[0].stride * COG_FRAME_CACHE_SIZE);
for (i = 0; i < COG_FRAME_CACHE_SIZE; i++) {
frame->cached_lines[0][i] = 0;
}
@ -114,7 +114,7 @@ cog_frame_new_virtual (CogMemoryDomain * domain, CogFrameFormat format,
CogFrameData *comp = &frame->components[i];
int j;
frame->regions[i] = malloc (comp->stride * COG_FRAME_CACHE_SIZE);
frame->regions[i] = g_malloc (comp->stride * COG_FRAME_CACHE_SIZE);
for (j = 0; j < COG_FRAME_CACHE_SIZE; j++) {
frame->cached_lines[i][j] = 0;
}