xalloc.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define safe_free(x)   while ((x)) { free_const((x)); (x) = NULL; }
 

Functions

void * xcalloc (size_t n, size_t sz)
 
void * xmalloc (size_t sz)
 
void * xrealloc (void *s, size_t sz)
 
void free_const (const void *s)
 
static void xfree (const void *p)
 

Macro Definition Documentation

#define safe_free (   x)    while ((x)) { free_const((x)); (x) = NULL; }

safe_free() - same as free(3). Used for portability. Accepts pointers to dynamically allocated const data. Will not call free(3) if the pointer is NULL. Sets the pointer to NULL on completion.

Use xfree() if the pointer does not need to be set afterward.

Define failure_notify to receive error message. otherwise perror() is used to display it.

Definition at line 73 of file xalloc.h.

Referenced by aclDestroyDenyInfoList(), AllocStrFromLSAStr(), Format::Format::assemble(), authenticateDigestNonceDelete(), build_groups_DN_array(), ErrorState::BuildContent(), Comm::CallbackTableDestruct(), carpInit(), Fs::Ufs::UFSSwapDir::changeIO(), cleanmember(), Fs::Ufs::UFSSwapDir::closeLog(), comm_exit(), Ftp::Client::connectDataChannel(), ACL::context(), decode_pub_auth(), ESIVariableProcessor::doFunction(), ESIVarState::doIt(), ESIVariableProcessor::doIt(), errorClean(), errorDynamicPageInfoDestroy(), errorInitialize(), esiWhen::evaluate(), ESIAssign::evaluateVariable(), free_access_log(), free_cachedir(), free_sslproxy_cert_adapt(), free_sslproxy_cert_sign(), free_string(), free_UrlHelperTimeout(), ClientHttpRequest::freeResources(), ftpListParseParts(), ftpListPartsFree(), ftpOpenListenSocket(), ftpTraverseDirectory(), ftpTrySlashHack(), Get_primaryGroup(), GetDomainName(), GetOSVersion(), gopherToHTML(), header_mangler_clean(), heap_free(), heap_walkDone(), helperOpenServers(), helperStatefulOpenServers(), ClientRequestContext::hostHeaderVerify(), htcpTstReply(), Ftp::Gateway::htmlifyListEntry(), Log::Format::HttpdCombined(), Log::Format::HttpdCommon(), icpUdpSend(), idnsAddNameserver(), idnsAddPathComponent(), idnsFreeNameservers(), idnsFreeSearchpath(), Ssl::Helper::Init(), ipcache_entry::latestError(), logfile_mod_udp_open(), lru_free(), lru_purgeDone(), lru_walkDone(), main(), make_pub_auth(), makeExternalAclKey(), netdbFreeNetdbEntry(), netdbPeerAdd(), netdbRelease(), netdbReloadState(), Log::TcpLogger::Open(), Fs::Ufs::UFSSwapDir::openTmpSwapLog(), HttpHdrSc::parse(), parse_eol(), parse_peer(), parse_port_option(), parse_string(), parse_TokenOrQuotedString(), Ftp::Client::parseControlReply(), parseOneConfigFile(), peerDigestRequest(), peerSourceHashInit(), peerUserHashInit(), process_options(), processingLoop(), ESIAssign::provideData(), purgeEntriesByHeader(), read_request(), Recursive_Memberof(), reset_auth(), clientReplyContext::sendMoreData(), Auth::UserRequest::setDenyMessage(), Comm::ConnOpener::setHost(), setLogUri(), HeaderManglers::setReplacement(), testRock::setUp(), UrnState::setUriResFromRequest(), snmpCreateOidFromStr(), Log::Format::SquidIcap(), Log::Format::SquidNative(), sslGetUserCertificateChainPEM(), sslGetUserCertificatePEM(), Ftp::Relay::stopDirTracking(), testHdrVisit(), testLowAndHigh(), testUfs::testUfsDefaultEngine(), testUfs::testUfsSearch(), Ftp::Gateway::unhack(), ConnStateData::unpinConnection(), CacheDigest::updateCapacity(), urnHandleReply(), urnParseReply(), Auth::User::username(), Valid_Global_Groups(), wccp2AssignBuckets(), WIN32_Subsystem_Init(), wordlistDestroy(), Fs::Ufs::UFSSwapDir::writeCleanDone(), Ftp::Client::writeCommand(), AccessLogEntry::~AccessLogEntry(), ACL::~ACL(), ACLCertificateData::~ACLCertificateData(), ACLFilledChecklist::~ACLFilledChecklist(), BlockingFile::~BlockingFile(), Ftp::Client::~Client(), ClientInfo::~ClientInfo(), clientReplyContext::~clientReplyContext(), TunnelStateData::Connection::~Connection(), Comm::ConnOpener::~ConnOpener(), Ftp::CtrlChannel::~CtrlChannel(), DiskdFile::~DiskdFile(), DiskThreadsDiskFile::~DiskThreadsDiskFile(), ErrorState::~ErrorState(), ESIContext::~ESIContext(), ESIInclude::~ESIInclude(), ESIVariableQuery::~ESIVariableQuery(), ESIVariableUserAgent::~ESIVariableUserAgent(), esiWhen::~esiWhen(), ExternalACLEntry::~ExternalACLEntry(), FileMap::~FileMap(), ICPState::~ICPState(), MmappedFile::~MmappedFile(), AnyP::PortCfg::~PortCfg(), Rock::SwapDir::~SwapDir(), Format::Token::~Token(), UrnState::~UrnState(), and Auth::UserRequest::~UserRequest().

Function Documentation

void free_const ( const void *  s)

free_const() - Same as free(3). Used for portability. Accepts pointers to dynamically allocated const data.

Define failure_notify to receive error message. otherwise perror() is used to display it.

Definition at line 169 of file xalloc.cc.

References free, free_const(), PROF_start, and PROF_stop.

Referenced by free_const(), and xfree().

void* xcalloc ( size_t  n,
size_t  sz 
)

xcalloc() - same as calloc(3). Used for portability. Never returns NULL; fatal on error.

Define failure_notify to receive error message. otherwise perror() is used to display it.

Definition at line 72 of file xalloc.cc.

References failure_notify, NULL, p, PROF_start, PROF_stop, and xcalloc().

Referenced by xcalloc().

static void xfree ( const void *  p)
inlinestatic

xfree() - same as free(3). Used for portability. Accepts pointers to dynamically allocated const data. Will not call free(3) if the pointer is NULL.

Pointer is left with a value on completion. Use safe_free() if the pointer needs to be set to NULL afterward.

Define failure_notify to receive error message. otherwise perror() is used to display it.

Definition at line 60 of file xalloc.h.

References free_const().

void* xmalloc ( size_t  sz)

xmalloc() - same as malloc(3). Used for portability. Never returns NULL; fatal on error.

Define failure_notify to receive error message. otherwise perror() is used to display it.

Definition at line 106 of file xalloc.cc.

References failure_notify, NULL, p, PROF_start, PROF_stop, and xmalloc().

Referenced by xmalloc().

void* xrealloc ( void *  s,
size_t  sz 
)

xrealloc() - same as realloc(3). Used for portability. Never returns NULL; fatal on error.

Definition at line 137 of file xalloc.cc.

References failure_notify, NULL, p, PROF_start, PROF_stop, and xrealloc().

Referenced by _heap_grow(), add_User_Group(), cbdataInternalInitType(), memReallocBuf(), parseOneConfigFile(), snmpAddNodeChild(), snmpCreateOidFromStr(), storeReplAdd(), WIN32_build_argv(), and xrealloc().

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors