XPTMethodDescriptor *old = id->method_descriptors, *new;   new = PR_REALLOC(old, (id->num_methods + num) * sizeof(XPTMethodDescriptor)); if (!new) return PR_FALSE;  memset(new + id->num_methods, 0, sizeof(XPTMethodDescriptor) * num); id->method_descriptors = new; id->num_methods += num; return PR_TRUE;
XPTAnnotation *ann = PR_NEWZAP(XPTAnnotation); if (!ann) return NULL; ann->flags = flags; if (XPT_ANN_IS_PRIVATE(flags)) { ann->creator = creator; ann->private_data = private_data; } return ann;
XPT_PUBLIC_API(PRBool)XPT_InterfaceDescriptorAddMethods(XPTInterfaceDescriptor *id, uint16 num){    XPTMethodDescriptor *old = id->method_descriptors, *new;    /* XXX should grow in chunks to minimize realloc overhead */    new = PR_REALLOC(old,                     (id->num_methods + num) * sizeof(XPTMethodDescriptor));    if (!new)        return PR_FALSE;    memset(new + id->num_methods, 0, sizeof(XPTMethodDescriptor) * num);    id->method_descriptors = new;    id->num_methods += num;    return PR_TRUE;}