[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 05/24] golang/xenlight: define KeyValueList builtin type
> So we *could* actually just `type KeyValueList struct { }`, and punt on > all these initialization questions until such time as it turns out that > they're needed. If there is no clear need for this type to be implemented in the Go package, then I would be in favor of not doing so. IMO, a smaller, more focused package is ideal. > On the other hand, I think we may need to actually think about > initializing structures. You've carefully coded DefBool such that the > "zero" value is undefined; but for DevId, for instance, the "initial" > value is supposed to be -1; but the way it's coded, an uninitialized Go > structure will end up as 0, which may be a valid devid. > > [...] > > Anyway, perhaps we can think about structure initialization, and > implement it after we do the basic structure / marshalling implementaiton. That's probably best. However, at a quick glance it seems like it would be pretty straight-forward to generate NewStructType functions analogous to libxl_struct_type_init, if that's the desired behavior. > In the mean time, we could either keep the KeyValueList you've > implemented here (perhaps adding a make() to the fromC method, and > having toC return NULL if kvl is NULL), or just replace it with a > placeholder until it's needed. > > What do you think? Based on what you said above, I think I would like to drop the implementation for now. But, if we keep the current implementation, I will make those corrections. -NR _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |