Don't use GMemChunk

master
Yevgen Muntyan 2006-03-25 03:40:31 -06:00
parent 7a383a0b93
commit fbc126e395
3 changed files with 2 additions and 16 deletions

View File

@ -193,8 +193,6 @@ static void moo_term_buffer_class_init (MooTermBufferClass *klass)
static void
moo_term_buffer_init (MooTermBuffer *buf)
{
_moo_term_line_mem_init ();
buf->priv = g_new0 (MooTermBufferPrivate, 1);
buf->priv->lines = g_ptr_array_new ();

View File

@ -42,8 +42,6 @@ struct _MooTermLine {
#define MOO_TERM_LINE_MAX_LEN (1 << 16)
void _moo_term_line_mem_init (void);
MooTermLine *_moo_term_line_new (guint width,
MooTermTextAttr fill);
void _moo_term_line_free (MooTermLine *line,

View File

@ -25,8 +25,6 @@ G_GNUC_UNUSED static MooTermCell EMPTY_CELL = {EMPTY_CHAR, MOO_TERM_ZERO_ATTR};
#define PTRCPY(dest__,src__,n__) memcpy (dest__, src__, (n__) * sizeof (gpointer))
#define PTRSET(s__,c__,n__) memset (s__, c__, (n__) * sizeof (gpointer))
static GMemChunk *LINE_MEM_CHUNK__ = NULL;
static gboolean line_has_tag_in_range (MooTermLine *line,
MooTermTag *tag,
@ -42,14 +40,6 @@ static int ptr_cmp (gconstpointer a,
}
void
_moo_term_line_mem_init (void)
{
if (!LINE_MEM_CHUNK__)
LINE_MEM_CHUNK__ = g_mem_chunk_create (MooTermLine, 512, G_ALLOC_AND_FREE);
}
MooTermLine*
_moo_term_line_new (guint width,
MooTermTextAttr attr)
@ -60,7 +50,7 @@ _moo_term_line_new (guint width,
g_assert (width != 0);
g_assert (width <= MOO_TERM_LINE_MAX_LEN);
line = g_chunk_new0 (MooTermLine, LINE_MEM_CHUNK__);
line = g_new0 (MooTermLine, 1);
line->cells = g_new (MooTermCell, width);
line->width = line->width_allocd__ = width;
@ -122,7 +112,7 @@ _moo_term_line_free (MooTermLine *line,
}
g_free (line->cells);
g_chunk_free (line, LINE_MEM_CHUNK__);
g_free (line);
}
}