195 |
#include <sys/types.h> |
#include <sys/types.h> |
196 |
#include <sys/stat.h> |
#include <sys/stat.h> |
197 |
|
|
198 |
|
#ifdef BOEHM_GC |
199 |
|
#include <gc.h> |
200 |
|
#endif |
201 |
|
|
202 |
#include "lisp.h" |
#include "lisp.h" |
203 |
#include "charset.h" |
#include "charset.h" |
204 |
#include "keyboard.h" |
#include "keyboard.h" |
5011 |
make_realized_face (attr) |
make_realized_face (attr) |
5012 |
Lisp_Object *attr; |
Lisp_Object *attr; |
5013 |
{ |
{ |
5014 |
struct face *face = (struct face *) xmalloc (sizeof *face); |
struct face *face = (struct face *) XGC_CALLOC (1, sizeof *face); |
|
bzero (face, sizeof *face); |
|
5015 |
face->ascii_face = face; |
face->ascii_face = face; |
5016 |
bcopy (attr, face->lface, sizeof face->lface); |
bcopy (attr, face->lface, sizeof face->lface); |
5017 |
return face; |
return face; |
5045 |
} |
} |
5046 |
#endif /* HAVE_WINDOW_SYSTEM */ |
#endif /* HAVE_WINDOW_SYSTEM */ |
5047 |
|
|
5048 |
xfree (face); |
XGC_FREE (face); |
5049 |
} |
} |
5050 |
} |
} |
5051 |
|
|
5359 |
struct face_cache *c; |
struct face_cache *c; |
5360 |
int size; |
int size; |
5361 |
|
|
5362 |
c = (struct face_cache *) xmalloc (sizeof *c); |
c = (struct face_cache *) XGC_CALLOC (1, sizeof *c); |
|
bzero (c, sizeof *c); |
|
5363 |
size = FACE_CACHE_BUCKETS_SIZE * sizeof *c->buckets; |
size = FACE_CACHE_BUCKETS_SIZE * sizeof *c->buckets; |
5364 |
c->buckets = (struct face **) xmalloc (size); |
c->buckets = (struct face **) XGC_MALLOC_ATOMIC (size); |
5365 |
bzero (c->buckets, size); |
bzero (c->buckets, size); |
5366 |
c->size = 50; |
c->size = 50; |
5367 |
c->faces_by_id = (struct face **) xmalloc (c->size * sizeof *c->faces_by_id); |
c->faces_by_id = (struct face **) XGC_MALLOC (c->size * sizeof *c->faces_by_id); |
5368 |
c->f = f; |
c->f = f; |
5369 |
c->menu_face_changed_p = menu_face_changed_default; |
c->menu_face_changed_p = menu_face_changed_default; |
5370 |
return c; |
return c; |
5512 |
if (c) |
if (c) |
5513 |
{ |
{ |
5514 |
free_realized_faces (c); |
free_realized_faces (c); |
5515 |
xfree (c->buckets); |
XGC_FREE (c->buckets); |
5516 |
xfree (c->faces_by_id); |
XGC_FREE (c->faces_by_id); |
5517 |
xfree (c); |
XGC_FREE (c); |
5518 |
} |
} |
5519 |
} |
} |
5520 |
|
|
5573 |
{ |
{ |
5574 |
int new_size = 2 * c->size; |
int new_size = 2 * c->size; |
5575 |
int sz = new_size * sizeof *c->faces_by_id; |
int sz = new_size * sizeof *c->faces_by_id; |
5576 |
c->faces_by_id = (struct face **) xrealloc (c->faces_by_id, sz); |
c->faces_by_id = (struct face **) XGC_REALLOC (c->faces_by_id, sz); |
5577 |
c->size = new_size; |
c->size = new_size; |
5578 |
} |
} |
5579 |
|
|