Mercurial > hg > xemacs-beta
diff src/device-x.c @ 3092:141c2920ea48
[xemacs-hg @ 2005-11-25 01:41:31 by crestani]
Incremental Garbage Collector
author | crestani |
---|---|
date | Fri, 25 Nov 2005 01:42:08 +0000 |
parents | facf3239ba30 |
children | 4d52aea479a2 |
line wrap: on
line diff
--- a/src/device-x.c Thu Nov 24 22:51:25 2005 +0000 +++ b/src/device-x.c Fri Nov 25 01:42:08 2005 +0000 @@ -109,11 +109,19 @@ { XD_END } }; +#ifdef NEW_GC +DEFINE_LRECORD_IMPLEMENTATION ("x-device", x_device, + 1, /*dumpable-flag*/ + 0, 0, 0, 0, 0, + x_device_data_description_1, + Lisp_X_Device); +#else /* not NEW_GC */ extern const struct sized_memory_description x_device_data_description; const struct sized_memory_description x_device_data_description = { sizeof (struct x_device), x_device_data_description_1 }; +#endif /* not NEW_GC */ /* Functions to synchronize mirroring resources and specifiers */ int in_resource_setting; @@ -202,7 +210,11 @@ static void allocate_x_device_struct (struct device *d) { +#ifdef NEW_GC + d->device_data = alloc_lrecord_type (struct x_device, &lrecord_x_device); +#else /* not NEW_GC */ d->device_data = xnew_and_zero (struct x_device); +#endif /* not NEW_GC */ } static void @@ -885,7 +897,11 @@ static void free_x_device_struct (struct device *d) { +#ifdef NEW_GC + mc_free (d->device_data); +#else /* not NEW_GC */ xfree (d->device_data, void *); +#endif /* not NEW_GC */ } static void @@ -2037,6 +2053,10 @@ void syms_of_device_x (void) { +#ifdef NEW_GC + INIT_LRECORD_IMPLEMENTATION (x_device); +#endif /* NEW_GC */ + DEFSUBR (Fx_debug_mode); DEFSUBR (Fx_get_resource); DEFSUBR (Fx_get_resource_prefix);