本文整理汇总了C++中ACL_ARRAY类的典型用法代码示例。如果您正苦于以下问题:C++ ACL_ARRAY类的具体用法?C++ ACL_ARRAY怎么用?C++ ACL_ARRAY使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ACL_ARRAY类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: http_hdr_req_free
void http_hdr_req_free(HTTP_HDR_REQ *hh)
{
ACL_ARRAY *pool;
if (hh == NULL)
return;
if (var_http_tls_cache <= 0 || cache_pool == NULL) {
__hdr_free_member(hh);
http_hdr_free((HTTP_HDR *) hh);
return;
}
#ifdef USE_TLS_EX
pool = (ACL_ARRAY*) acl_pthread_tls_get(&cache_key);
if (pool != NULL) {
pool->push_back(pool, hh);
return;
}
#else
pool = (ACL_ARRAY*) acl_pthread_getspecific(cache_key);
if (pool != NULL && acl_array_size(pool) < var_http_tls_cache) {
pool->push_back(pool, hh);
return;
}
#endif
__hdr_free_member(hh);
http_hdr_free((HTTP_HDR *) hh);
}
示例2: http_hdr_new
HTTP_HDR_REQ *http_hdr_req_new(void)
{
HTTP_HDR_REQ *hh;
ACL_ARRAY *pool;
if (var_http_tls_cache <= 0) {
hh = (HTTP_HDR_REQ *) http_hdr_new(sizeof(HTTP_HDR_REQ));
__hdr_init(hh);
return hh;
}
#ifdef USE_TLS_EX
pool = (ACL_ARRAY*) acl_pthread_tls_get(&cache_key);
if (pool == NULL) {
pool = acl_array_create(100);
acl_pthread_tls_set(cache_key, pool,
(void (*)(void*)) thread_cache_free);
}
pool = (ACL_ARRAY*) acl_pthread_tls_get(&cache_key);
hh = (HTTP_HDR_REQ*) pool->pop_back(pool);
if (hh) {
__hdr_reset(hh, 1);
http_hdr_reset((HTTP_HDR *) hh);
return hh;
}
#else
acl_pthread_once(&once_control, cache_init);
pool = (ACL_ARRAY*) acl_pthread_getspecific(cache_key);
if (pool == NULL) {
pool = acl_array_create(100);
acl_pthread_setspecific(cache_key, pool);
if ((unsigned long) acl_pthread_self() == acl_main_thread_self()) {
cache_pool = pool;
atexit(main_cache_free);
}
}
hh = (HTTP_HDR_REQ*) pool->pop_back(pool);
if (hh) {
__hdr_reset(hh, 1);
http_hdr_reset((HTTP_HDR *) hh);
return hh;
}
#endif
hh = (HTTP_HDR_REQ *) http_hdr_new(sizeof(HTTP_HDR_REQ));
__hdr_init(hh);
return hh;
}
示例3: next_attr
const xml_attr* xml_node::next_attr(void) const
{
ACL_ARRAY* a = node_->attr_list;
if (a == NULL)
return NULL;
acl_assert(attr_iter_);
acl_assert(attr_);
ACL_XML_ATTR* attr = (ACL_XML_ATTR*) a->iter_next(attr_iter_, a);
if (attr == NULL)
return NULL;
const_cast<xml_node*>(this)->attr_->node_ = const_cast<xml_node*>(this);
const_cast<xml_node*>(this)->attr_->attr_ = attr;
return attr_;
}
示例4:
const xml_attr* xml2_node::next_attr(void) const
{
ACL_ARRAY* a = node_->attr_list;
if (a == NULL)
return NULL;
acl_assert(attr_iter_);
ACL_XML2_ATTR* attr = (ACL_XML2_ATTR*) a->iter_next(attr_iter_, a);
if (attr == NULL)
return NULL;
xml2_attr* xa = NEW xml2_attr(const_cast<xml2_node*>(this), attr);
const_cast<xml2_node*>(this)->attrs_tmp_.push_back(xa);
return xa;
}
示例5: first_attr
const xml_attr* xml_node::first_attr(void) const
{
ACL_ARRAY* a = node_->attr_list;
if (a == NULL)
return NULL;
if (attr_iter_ == NULL)
const_cast<xml_node*>(this)->attr_iter_ =
(ACL_ITER*) acl_mymalloc(sizeof(ACL_ITER));
ACL_XML_ATTR* attr = (ACL_XML_ATTR*) a->iter_head(attr_iter_, a);
if (attr == NULL)
return NULL;
if (attr_ == NULL)
const_cast<xml_node*>(this)->attr_ = NEW xml_attr();
const_cast<xml_node*>(this)->attr_->node_ = const_cast<xml_node*>(this);
const_cast<xml_node*>(this)->attr_->attr_ = attr;
return attr_;
}