comparison 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
comparison
equal deleted inserted replaced
3091:c22d8984148c 3092:141c2920ea48
107 { XD_LISP_OBJECT, offsetof (struct x_device, x_keysym_map_hash_table) }, 107 { XD_LISP_OBJECT, offsetof (struct x_device, x_keysym_map_hash_table) },
108 { XD_LISP_OBJECT, offsetof (struct x_device, WM_COMMAND_frame) }, 108 { XD_LISP_OBJECT, offsetof (struct x_device, WM_COMMAND_frame) },
109 { XD_END } 109 { XD_END }
110 }; 110 };
111 111
112 #ifdef NEW_GC
113 DEFINE_LRECORD_IMPLEMENTATION ("x-device", x_device,
114 1, /*dumpable-flag*/
115 0, 0, 0, 0, 0,
116 x_device_data_description_1,
117 Lisp_X_Device);
118 #else /* not NEW_GC */
112 extern const struct sized_memory_description x_device_data_description; 119 extern const struct sized_memory_description x_device_data_description;
113 120
114 const struct sized_memory_description x_device_data_description = { 121 const struct sized_memory_description x_device_data_description = {
115 sizeof (struct x_device), x_device_data_description_1 122 sizeof (struct x_device), x_device_data_description_1
116 }; 123 };
124 #endif /* not NEW_GC */
117 125
118 /* Functions to synchronize mirroring resources and specifiers */ 126 /* Functions to synchronize mirroring resources and specifiers */
119 int in_resource_setting; 127 int in_resource_setting;
120 128
121 /************************************************************************/ 129 /************************************************************************/
200 static struct device *device_being_initialized = NULL; 208 static struct device *device_being_initialized = NULL;
201 209
202 static void 210 static void
203 allocate_x_device_struct (struct device *d) 211 allocate_x_device_struct (struct device *d)
204 { 212 {
213 #ifdef NEW_GC
214 d->device_data = alloc_lrecord_type (struct x_device, &lrecord_x_device);
215 #else /* not NEW_GC */
205 d->device_data = xnew_and_zero (struct x_device); 216 d->device_data = xnew_and_zero (struct x_device);
217 #endif /* not NEW_GC */
206 } 218 }
207 219
208 static void 220 static void
209 Xatoms_of_device_x (struct device *d) 221 Xatoms_of_device_x (struct device *d)
210 { 222 {
883 /************************************************************************/ 895 /************************************************************************/
884 896
885 static void 897 static void
886 free_x_device_struct (struct device *d) 898 free_x_device_struct (struct device *d)
887 { 899 {
900 #ifdef NEW_GC
901 mc_free (d->device_data);
902 #else /* not NEW_GC */
888 xfree (d->device_data, void *); 903 xfree (d->device_data, void *);
904 #endif /* not NEW_GC */
889 } 905 }
890 906
891 static void 907 static void
892 x_delete_device (struct device *d) 908 x_delete_device (struct device *d)
893 { 909 {
2035 /************************************************************************/ 2051 /************************************************************************/
2036 2052
2037 void 2053 void
2038 syms_of_device_x (void) 2054 syms_of_device_x (void)
2039 { 2055 {
2056 #ifdef NEW_GC
2057 INIT_LRECORD_IMPLEMENTATION (x_device);
2058 #endif /* NEW_GC */
2059
2040 DEFSUBR (Fx_debug_mode); 2060 DEFSUBR (Fx_debug_mode);
2041 DEFSUBR (Fx_get_resource); 2061 DEFSUBR (Fx_get_resource);
2042 DEFSUBR (Fx_get_resource_prefix); 2062 DEFSUBR (Fx_get_resource_prefix);
2043 DEFSUBR (Fx_put_resource); 2063 DEFSUBR (Fx_put_resource);
2044 2064