Lines Matching refs:ctx
44 hprof_context_t *ctx = (hprof_context_t *)calloc(1, sizeof(*ctx));
45 if (ctx == NULL) {
51 hprofContextInit(ctx, strdup(outputFileName), fd, false, directToDdms);
53 assert(ctx->memFp != NULL);
55 return ctx;
158 * Free any heap-allocated items in "ctx", and then free "ctx" itself.
160 void hprofFreeContext(hprof_context_t *ctx)
162 assert(ctx != NULL);
164 /* we don't own ctx->fd, do not close */
166 if (ctx->memFp != NULL)
167 fclose(ctx->memFp);
168 free(ctx->curRec.body);
169 free(ctx->fileName);
170 free(ctx->fileDataPtr);
171 free(ctx);
196 hprof_context_t *ctx;
206 ctx = (hprof_context_t *)arg;
207 ctx->gcScanState = xlate[type];
208 ctx->gcThreadSerialNumber = threadId;
209 hprofMarkRootObject(ctx, obj, 0);
210 ctx->gcScanState = 0;
211 ctx->gcThreadSerialNumber = 0;
221 hprof_context_t *ctx = (hprof_context_t *)arg;
222 hprofDumpHeapObject(ctx, obj);
239 hprof_context_t *ctx;
245 ctx = hprofStartup(fileName, fd, directToDdms);
246 if (ctx == NULL) {
249 dvmVisitRoots(hprofRootVisitor, ctx);
250 dvmHeapBitmapWalk(dvmHeapSourceGetLiveBits(), hprofBitmapCallback, ctx);
251 hprofFinishHeapDump(ctx);
253 success = hprofShutdown(ctx) ? 0 : -1;