From: Duilio J. P. <dp...@fc...> - 2004-07-04 23:00:41
|
I was thinking about to include in the library a Glib like macro to make request of memory initialized to 0. It will fail if malloc returns NULL, showing an useful message. Looks something like: void *visual_malloc0 (size_t nbytes); #define visual_new0(struct_type, n_structs) \ ((struct_type *) visual_malloc0 (((size_t) sizeof (struct_type)) * ((size_t) (n_structs)))) This will let us require memory without checking the return value and showing a message accordingly. People, what do you think? Duilio. |