/* Licensed to the Apache Software Foundation (ASF) under one or more *contributorlicenseagreements.SeetheNOTICEfiledistributedwith *thisworkforadditionalinformationregardingcopyrightownership. *TheASFlicensesthisfiletoYouundertheApacheLicense,Version2.0 *(the"License");youmaynotusethisfileexceptincompliancewith *theLicense.YoumayobtainacopyoftheLicenseat * *http://www.apache.org/licenses/LICENSE-2.0 * *Unlessrequiredbyapplicablelaworagreedtoinwriting,software *distributedundertheLicenseisdistributedonan"ASIS"BASIS, *WITHOUTWARRANTIESORCONDITIONSOFANYKIND,eitherexpressorimplied. *SeetheLicenseforthespecificlanguagegoverningpermissionsand *limitationsundertheLicense.
*/
/* Memory handler for a plain memory divided in slot. *Thisoneusesplainmemory.
*/
struct ap_slotmem_instance_t { char *name; /* per segment name */ void *base; /* data set start */
apr_size_t size; /* size of each memory slot */ unsignedint num; /* number of mem slots */
apr_pool_t *gpool; /* per segment global pool */ char *inuse; /* in-use flag table*/
ap_slotmem_type_t type; /* type-specific flags */ struct ap_slotmem_instance_t *next; /* location of next allocated segment */
};
/* global pool and list of slotmem we are handling */ staticstruct ap_slotmem_instance_t *globallistmem = NULL; static apr_pool_t *gpool = NULL;
if (name) { if (name[0] == ':')
fname = name; else
fname = ap_runtime_dir_relative(pool, name);
/* first try to attach to existing slotmem */ if (next) { for (;;) { if (strcmp(next->name, fname) == 0) { /* we already have it */
*new = next; return APR_SUCCESS;
} if (!next->next) { break;
}
next = next->next;
}
}
} else
fname = "anonymous";
/* create the memory using the gpool */
res = (ap_slotmem_instance_t *) apr_pcalloc(gpool, sizeof(ap_slotmem_instance_t));
res->base = apr_pcalloc(gpool, basesize + (item_num * sizeof(char))); if (!res->base) return APR_ENOSHMAVAIL;
if (name) { if (name[0] == ':')
fname = name; else
fname = ap_runtime_dir_relative(pool, name);
} else return APR_ENOSHMAVAIL;
/* first try to attach to existing slotmem */ while (next) { if (strcmp(next->name, fname) == 0) { /* we already have it */
*new = next;
*item_size = next->size;
*item_num = next->num; return APR_SUCCESS;
}
next = next->next;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.