On Mon 01 Apr 2013 22:03, Mark H Weaver <m...@netris.org> writes: >>> SCM z = scm_cons (SCM_EOL, SCM_EOL); >>> - scm_t_port *entry = (scm_t_port *) scm_gc_calloc (sizeof (scm_t_port), >>> "port"); >>> + scm_t_port *entry = scm_gc_typed_calloc (scm_t_port); >>> + scm_t_port_internal *pti = scm_gc_typed_calloc (scm_t_port_internal); >>> const char *enc; >> >> How about allocating a struct { scm_t_port a; scm_t_port_internal b; } >> and get the pointers from there? > > I was hoping to do something like this in master, but having thought > about it some more, I don't see how to do this without running afoul of > the strict aliasing rules.
Though we already violate them in innumerable ways in Guile, this is not one of those cases: struct foo { a a; b b; } *foo; foo = malloc (sizeof (*foo)); a* a = &bar.a; b* b = &bar.b; Andy -- http://wingolog.org/