rpm 5.3.7
|
#include "system.h"
#include <rpmiotypes.h>
#include <rpmio.h>
#include <rpmlog.h>
#include <yarn.h>
#include "debug.h"
Go to the source code of this file.
Data Structures | |
struct | rpmioPool_s |
Defines | |
#define | EXIT_FAILURE 1 |
Functions | |
void * | vmefail (size_t size) |
rpmioPool | rpmioFreePool (rpmioPool pool) |
Reclaim memory pool items. | |
rpmioPool | rpmioNewPool (const char *name, size_t size, int limit, int flags, char *(*dbg)(void *item), void(*init)(void *item), void(*fini)(void *item)) |
Create a memory pool. | |
rpmioItem | rpmioUnlinkPoolItem (rpmioItem item, const char *msg, const char *fn, unsigned ln) |
Decrement a pool item refcount. | |
rpmioItem | rpmioLinkPoolItem (rpmioItem item, const char *msg, const char *fn, unsigned ln) |
Increment a pool item refcount. | |
void * | rpmioFreePoolItem (rpmioItem item, const char *msg, const char *fn, unsigned ln) |
Free a pool item. | |
rpmioItem | rpmioGetPool (rpmioPool pool, size_t size) |
Get unused item from pool, or alloc a new item. | |
rpmioItem | rpmioPutPool (rpmioItem item) |
Put unused item into pool (or free). | |
void * | xmalloc (size_t size) |
void * | xcalloc (size_t nmemb, size_t size) |
void * | xrealloc (void *ptr, size_t size) |
char * | xstrdup (const char *str) |
Variables | |
static rpmioPool | _rpmioPool |
Definition in file rpmmalloc.c.
#define EXIT_FAILURE 1 |
Definition at line 20 of file rpmmalloc.c.
Referenced by vmefail().
Reclaim memory pool items.
pool | memory pool (NULL uses global rpmio pool) |
Definition at line 68 of file rpmmalloc.c.
References _free(), _rpmioPool, D_, rpmioPool_s::have, rpmioPool_s::head, rpmioPool_s::made, rpmioPool_s::name, rpmioItem_s::pool, rpmioPool_s::reused, rpmlog(), RPMLOG_DEBUG, RPMLOG_WARNING, rpmioItem_s::use, and VALGRIND_DESTROY_MEMPOOL.
Referenced by main(), rpmcliFini(), and rpmioClean().
void* rpmioFreePoolItem | ( | rpmioItem | item, |
const char * | msg, | ||
const char * | fn, | ||
unsigned | ln | ||
) |
Free a pool item.
item | pool item |
msg | debugging msg (NULL disables debugging) |
fn | usually __FILE__ |
ln | usually __LINE__ |
Definition at line 178 of file rpmmalloc.c.
References rpmioPool_s::dbg, rpmioPool_s::fini, rpmioPool_s::flags, L, rpmioPool_s::name, rpmioItem_s::pool, rpmioPutPool(), rpmioItem_s::use, and VALGRIND_MEMPOOL_FREE.
Referenced by mireFreeAll(), rpmDigestFinal(), rpmDigestInit(), rpmmiInit(), and urlFini().
Get unused item from pool, or alloc a new item.
pool | memory pool (NULL will always alloc a new item) |
size | item size |
Definition at line 210 of file rpmmalloc.c.
References rpmioPool_s::have, rpmioPool_s::head, rpmioPool_s::limit, rpmioPool_s::made, rpmioItem_s::pool, rpmioPool_s::reused, rpmioPool_s::tail, rpmioItem_s::use, VALGRIND_MEMPOOL_ALLOC, and xcalloc().
Referenced by ctxGetPool(), digGetPool(), fdGetPool(), headerGetPool(), htGetPool(), mireGetPool(), pkgGetPool(), rpmdbGetPool(), rpmdsGetPool(), rpmfcGetPool(), rpmfiGetPool(), rpmgiGetPool(), rpmiobGetPool(), rpmjsGetPool(), rpmmgGetPool(), rpmmiGetPool(), rpmperlGetPool(), rpmpsGetPool(), rpmpsmGetPool(), rpmpythonGetPool(), rpmrepoGetPool(), rpmrubyGetPool(), rpmsqlGetPool(), rpmsquirrelGetPool(), rpmtclGetPool(), rpmteGetPool(), rpmtsGetPool(), rpmtsiGetPool(), rpmvcGetPool(), rpmvtGetPool(), rpmxarGetPool(), specGetPool(), and urlGetPool().
Increment a pool item refcount.
item | pool item |
msg | debugging msg (NULL disables debugging) |
fn | usually __FILE__ |
ln | usually __LINE__ |
Definition at line 158 of file rpmmalloc.c.
References rpmioPool_s::dbg, rpmioPool_s::flags, rpmioPool_s::name, rpmioItem_s::pool, and rpmioItem_s::use.
Referenced by newPackage(), newSpec(), rpmDigestDup(), rpmDigestInit(), rpmmiInit(), XfdNew(), XrpmtsiInit(), and XurlNew().
rpmioPool rpmioNewPool | ( | const char * | name, |
size_t | size, | ||
int | limit, | ||
int | flags, | ||
char *(*)(void *item) | dbg, | ||
void(*)(void *item) | init, | ||
void(*)(void *item) | fini | ||
) |
Create a memory pool.
name | pool name |
size | item size |
limit | no. of items permitted (-1 for unlimited) |
flags | debugging flags |
(*dbg)() | generate string for Unlink/Link/Free debugging |
(*init)() | create item contents |
(*fini)() | destroy item contents |
Definition at line 103 of file rpmmalloc.c.
References D_, rpmioPool_s::dbg, rpmioPool_s::fini, rpmioPool_s::flags, rpmioPool_s::have, rpmioPool_s::head, rpmioPool_s::init, rpmioPool_s::limit, rpmioPool_s::made, name, rpmioPool_s::name, rpmioPool_s::pool, rpmioPool_s::reused, rpmlog(), RPMLOG_DEBUG, rpmioPool_s::size, rpmioPool_s::tail, VALGRIND_CREATE_MEMPOOL, xcalloc(), and rpmioPool_s::zlog.
Referenced by ctxGetPool(), digGetPool(), fdGetPool(), headerGetPool(), htGetPool(), mireGetPool(), pkgGetPool(), rpmdbGetPool(), rpmdsGetPool(), rpmfcGetPool(), rpmfiGetPool(), rpmgiGetPool(), rpmiobGetPool(), rpmjsGetPool(), rpmmgGetPool(), rpmmiGetPool(), rpmperlGetPool(), rpmpsGetPool(), rpmpsmGetPool(), rpmpythonGetPool(), rpmrepoGetPool(), rpmrubyGetPool(), rpmsqlGetPool(), rpmsquirrelGetPool(), rpmtclGetPool(), rpmteGetPool(), rpmtsGetPool(), rpmtsiGetPool(), rpmvcGetPool(), rpmvtGetPool(), rpmxarGetPool(), specGetPool(), and urlGetPool().
Put unused item into pool (or free).
_item | unused item |
Definition at line 254 of file rpmmalloc.c.
References _free(), rpmioPool_s::have, rpmioItem_s::pool, rpmioPool_s::tail, and rpmioItem_s::use.
Referenced by headerLoad(), rpmdbClose(), rpmdbNew(), and rpmioFreePoolItem().
Decrement a pool item refcount.
item | pool item |
msg | debugging msg (NULL disables debugging) |
fn | usually __FILE__ |
ln | usually __LINE__ |
Definition at line 137 of file rpmmalloc.c.
References rpmioPool_s::dbg, rpmioPool_s::flags, rpmioPool_s::name, rpmioItem_s::pool, and rpmioItem_s::use.
void* vmefail | ( | size_t | size | ) |
Definition at line 24 of file rpmmalloc.c.
References _, and EXIT_FAILURE.
Referenced by xcalloc(), xmalloc(), xrealloc(), and xstrdup().
void* xcalloc | ( | size_t | nmemb, |
size_t | size | ||
) |
Definition at line 290 of file rpmmalloc.c.
References vmefail().
Referenced by _tagName(), addTriggerIndex(), argiAdd(), base64Format(), bncdataFormat(), cdataFormat(), checkResponse(), db3Acallback(), dbiMireKeys(), dbiTagsInit(), dnlInitIterator(), findTag(), fsmMkdirs(), fssizesTag(), ftpNLST(), ftpOpendir(), genCpioListAndHeader(), getFilesystemList(), grabArgs(), handleOverlappedFiles(), headerLoad(), headerNew(), htCreate(), htGetKeys(), IDTXnew(), initGlobs(), iosmMkdirs(), main(), mapInitIterator(), mireRegcomp(), mireSkip(), missingokTag(), mtreeSpec(), newFSM(), newIOSM(), newItem(), parseCVOG(), parseFormat(), parseSpec(), pgpGrabPkts(), processMetadataFile(), processSourceFiles(), rdLead(), rpmalCreate(), rpmbcInit(), rpmdbNew(), rpmDigestInit(), rpmdsNew(), rpmdsNewPRCO(), rpmdsSetColor(), rpmdsSetRefs(), rpmdsSetResult(), rpmdsSingle(), rpmecNew(), rpmEVRnew(), rpmfcGenerateDepends(), rpmfcNew(), rpmfiBuildFNames(), rpmfiFpLookup(), rpmfiNew(), rpmfiOpendir(), rpmGetFilesystemUsage(), rpmGetMacroEntries(), rpmgiNew(), rpmHmacInit(), rpmhookArgsNew(), rpmhookTableAddItem(), rpmhookTableNew(), rpmiobNew(), rpmioGetPool(), rpmioNewPool(), rpmioParse(), rpmmiGrow(), rpmmiGrowBasename(), rpmmiInit(), rpmpsAppend(), rpmpsInitIterator(), rpmpsmNew(), rpmReadPackageManifest(), rpmteNewTSI(), rpmtsCreate(), rpmtsInitDSI(), rpmvfNew(), saveHardLink(), scpNew(), showQueryPackage(), spewescapeFormat(), sql_cget(), sql_open(), sql_stat(), str2uuid(), tagLoadATags(), tagLoadIndex(), tv2uuidv1(), vfs_parse_ls_lga(), XfdNew(), and XurlNew().
void* xmalloc | ( | size_t | size | ) |
Definition at line 280 of file rpmmalloc.c.
References vmefail().
Referenced by _str2PCREpat(), _tagCanonicalize(), addFile(), addSource(), addTE(), argvJoin(), argvSplit(), arSetup(), bin2hex(), copyEntry(), cpioHeaderRead(), db3Acallback(), dbiMireKeys(), dbinstanceTag(), debevrfmtTag(), debmd5sumsTag(), doAddSubtract(), doLookup(), doputenv(), dosetenv(), dupMacroEntry(), expandMacro(), expandMacroTable(), FDGsqlTag(), FDGxmlTag(), FDGyamlTag(), formatValue(), fpCacheCreate(), fpLookupSubdir(), fsmFsPath(), fsmStage(), genCpioListAndHeader(), glob(), glob_in_dir(), grabData(), handleOneTrigger(), headerAddI18NString(), headerAppendEntry(), headerCheck(), headerendoffTag(), headerInit(), headerMap(), headerstartoffTag(), headerUnload(), hGetNVRA(), htAddEntry(), iosmFsPath(), iosmStage(), loadDBT(), localeTag(), machAddEquiv(), main(), makeGPGSignature(), mireDup(), mtreeReadExcludes(), mtreeVisitF(), needswhatTag(), newOpenFileInfo(), newSl(), newSpec(), newSt(), parseForLang(), parseRCPOT(), pgpArmorWrap(), pgpMpiHex(), pgpMpiSet(), pgpPrtUserID(), pkgmtimeTag(), pkgsizeTag(), PRCOsqlTag(), PRCOxmlTag(), PRCOyamlTag(), prefix_array(), printNewSpecfile(), pushMacro(), queryArgCallback(), rdSignature(), readLine(), relocateFileList(), rpmbcExportPubkey(), rpmbcExportSignature(), rpmbcSetRSA(), rpmcliImportPubkey(), rpmdcPrintCoreutils(), rpmdcPrintZeroInstall(), rpmDigestDup(), rpmDigestFinal(), rpmdsDup(), rpmdsDupArgv(), rpmdsGetconf(), rpmdsMerge(), rpmdsNewDNEVR(), rpmdsSingle(), rpmdsThis(), rpmExpand(), rpmfd_Fopen(), rpmfiBuildFClasses(), rpmfiBuildFDeps(), rpmfiBuildFNames(), rpmfiDupeRelocations(), rpmfiFN(), rpmfiNew(), rpmgiEscapeSpaces(), rpmGlob(), rpmheRealloc(), rpmInitMacros(), rpmiobSlurp(), rpmMCExpand(), rpmmiInit(), rpmProblemString(), rpmpsmStage(), rpmReadHeader(), rpmRebuildTargetVars(), rpmteChain(), rpmtsFindPubkey(), rpmtsPrepare(), runInstScript(), runScript(), runTriggersLoop(), set(), shescapeFormat(), showQueryPackage(), sql_cget(), sql_step(), strsubFormat(), tag2uuidv5(), tarHeaderRead(), tarHeaderReadName(), triggercondsTag(), triggertypeTag(), urlFind(), urlStrdup(), uuidFormat(), valueMakeInteger(), valueMakeString(), vrpmlog(), whatneedsTag(), writeLinkedFile(), XpoptDupArgv(), XpoptParseArgvString(), xstrtolocale(), and yamlFormat().
void* xrealloc | ( | void * | ptr, |
size_t | size | ||
) |
Definition at line 301 of file rpmmalloc.c.
References vmefail().
Referenced by _poptSaveString(), addFile(), argiAdd(), argvAdd(), argvAppend(), cacheStashLatest(), currentDirectory(), dbiAppendSet(), dbiTagsInit(), enterChroot(), expandMacroTable(), fdInitDigest(), fsmMkdirs(), ftpNLST(), getFilesystemList(), gidToGname(), glob(), glob_in_dir(), gnameToGid(), handleInstInstalledFile(), headerAddEntry(), headerAddI18NString(), headerAppendEntry(), headerSprintf(), hsaReserve(), htAddEntry(), IDTXgrow(), installArgCallback(), iosmMkdirs(), isPart(), machAddEquiv(), mireAppend(), parseForLang(), pgpsigFormat(), pgpStashKeyid(), pkgUnpackagedSubdirs(), queryArgCallback(), readLineFromOFI(), relocateFileList(), removePackage(), rpmalAdd(), rpmalAllFileSatisfiesDepend(), rpmalAllSatisfiesDepend(), rpmalDel(), rpmalMakeIndex(), rpmcliAllArgCallback(), rpmExpand(), rpmfcExpandAppend(), rpmfiAddRelocation(), rpmfiNew(), rpmGetMacroEntries(), rpmGlob(), rpmiobAppend(), rpmiobSlurp(), rpmMCExpand(), rpmmiAddPattern(), rpmpsAppend(), rpmtsAddInstallElement(), rpmtsAvailable(), rpmtsSolve(), showQueryPackage(), sql_step(), stashSt(), triggercondsTag(), uidToUname(), unameToUid(), urlFind(), vrpmlog(), and xstrtolocale().
char* xstrdup | ( | const char * | str | ) |
Definition at line 311 of file rpmmalloc.c.
References vmefail().
Referenced by _poptSaveString(), _rpmtsCheck(), addFile(), addSource(), addTE(), addTriggerIndex(), argvAdd(), argvAppend(), argvSplit(), arHeaderRead(), armorFormat(), base64Format(), bncdataFormat(), cacheStashLatest(), cdataFormat(), cpio_doio(), createDir(), db3associate(), db3associate_foreign(), dbiFindMatches(), dbiTagsInit(), depflagsFormat(), deptypeFormat(), digestFormat(), doLookup(), doPatch(), doSetupMacro(), doUntar(), dupAttrRec(), expandMacro(), fdSetOpen(), fflagsFormat(), forceIncludeFile(), formatValue(), fpLookupSubdir(), fsmMakeLinks(), fsmStage(), ftpRealpath(), genSourceRpmName(), getFilesystemList(), getGidS(), getGname(), getGnameS(), getUidS(), getUname(), getUnameS(), glob(), headerCheck(), headerNEVRA(), headerReload(), headerSetBaseURL(), headerSetDigest(), headerSetOrigin(), headerSetParent(), headerSprintf(), i18nTag(), iconvFormat(), installArgCallback(), instprefixTag(), intFormat(), iosmMakeLinks(), iosmStage(), iosmStrerror(), isPart(), jsonFormat(), localeTag(), lookupPackage(), machAddEquiv(), main(), mireDup(), mireRegcomp(), mireSetLocale(), mtreeReadExcludes(), parseChangelog(), parseCVOG(), parseExpressionBoolean(), parseExpressionString(), parseForSimple(), parseRCPOT(), parseScript(), parseSimplePart(), parseSpec(), permsFormat(), pgpsigFormat(), pkgbaseurlTag(), pkgdigestTag(), pkgoriginTag(), pkgUnpackagedSubdirs(), populateInstallHeader(), printNewSpecfile(), processPackageFiles(), processSourceFiles(), pushMacro(), rdLead(), rdSignature(), rdToken(), readLineFromOFI(), realDateFormat(), Realpath(), rpmalAdd(), rpmalAllFileSatisfiesDepend(), rpmcliAllArgCallback(), rpmcliConfigured(), rpmcliImportPubkey(), rpmcliInit(), rpmcliInstall(), rpmcliQuery(), rpmcliWalkFirst(), rpmdbExportInfo(), rpmdbURIPath(), rpmdcParseCoreutils(), rpmdcParseZeroInstall(), rpmds_compare(), rpmds_iternext(), rpmds_Single(), rpmdsCpuinfo(), rpmdsELF(), rpmdsGetconf(), rpmdsLdconfig(), rpmdsNew(), rpmdsSysinfo(), rpmdsThis(), rpmEVRmire(), rpmEVRorder(), rpmEVRparse(), rpmExpand(), rpmfcGenerateDepends(), rpmfd_Fopen(), rpmfi_BN(), rpmfi_Digest(), rpmfi_DN(), rpmfi_FClass(), rpmfi_FGroup(), rpmfi_FLink(), rpmfi_FN(), rpmfi_FUser(), rpmfi_subscript(), rpmfiAddRelocation(), rpmfiDupeRelocations(), rpmfiNew(), rpmGetPath(), rpmgiInitFilter(), rpmgiNext(), rpmGlob(), rpmInitMacros(), rpmInstallSourcePackage(), rpmioAllArgCallback(), rpmioInit(), rpmioParse(), rpmkuFindPubkey(), rpmkuPassPhrase(), rpmlibMarkers(), rpmMCExpand(), rpmmgBuffer(), rpmmgFile(), rpmmgNew(), rpmmiInit(), rpmPermsString(), rpmps_ass_sub(), rpmpsAppend(), rpmpsmStage(), rpmpythonSlurp(), rpmQueryVerify(), rpmReadHeader(), rpmRebuildTargetVars(), rpmrepoCloseMDFile(), rpmrepoDoPkgMetadata(), rpmrepoDoRepoMetadata(), rpmrepoRealpath(), rpmSetMachine(), rpmsqlNew(), rpmsqlRun(), rpmts_Check(), rpmtsFindPubkey(), rpmtsSetCurrDir(), rpmtsSetRootDir(), rpmWriteHeader(), rpnFormat(), runTriggersLoop(), shescapeFormat(), spewescapeFormat(), sql_open(), sql_step(), stashSt(), statFormat(), strdup_locale_convert(), strsubFormat(), triggercondsTag(), triggertypeFormat(), triggertypeTag(), unsatisfiedDepend(), urlFind(), urlSplit(), uuidFormat(), vrpmlog(), wnlookupTag(), writeFile(), writeLinkedFile(), writeRPM(), xmlFormat(), and yamlFormat().
rpmioPool _rpmioPool [static] |
Definition at line 66 of file rpmmalloc.c.
Referenced by rpmioFreePool().