Home | History | Annotate | Download | only in libdex

Lines Matching refs:pCache

36 void dexStringCacheAlloc(DexStringCache* pCache, size_t length) {
37 if (pCache->allocatedSize != 0) {
38 if (pCache->allocatedSize >= length) {
41 free((void*) pCache->value);
44 if (length <= sizeof(pCache->buffer)) {
45 pCache->value = pCache->buffer;
46 pCache->allocatedSize = 0;
48 pCache->value = (char*) malloc(length);
49 pCache->allocatedSize = length;
57 void dexStringCacheInit(DexStringCache* pCache) {
58 pCache->value = pCache->buffer;
59 pCache->allocatedSize = 0;
60 pCache->buffer[0] = '\0';
67 void dexStringCacheRelease(DexStringCache* pCache) {
68 if (pCache->allocatedSize != 0) {
69 free((void*) pCache->value);
70 pCache->value = pCache->buffer;
71 pCache->allocatedSize = 0;
82 char* dexStringCacheEnsureCopy(DexStringCache* pCache, const char* value) {
83 if (value != pCache->value) {
85 dexStringCacheAlloc(pCache, length);
86 memcpy(pCache->value, value, length);
89 return pCache->value;
99 char* dexStringCacheAbandon(DexStringCache* pCache, const char* value) {
100 if ((value == pCache->value) && (pCache->allocatedSize != 0)) {
101 char* result = pCache->value;
102 pCache->allocatedSize = 0;
103 pCache->value = pCache->buffer;
134 DexStringCache* pCache) {
149 dexStringCacheAlloc(pCache, length);
151 char *at = (char*) pCache->value;
164 return pCache->value;
178 DexStringCache* pCache) {
195 dexStringCacheAlloc(pCache, length);
196 char *at = (char*) pCache->value;
208 return pCache->value;