Lines Matching refs:heap
123 _XtHeapInit(Heap *heap)
125 heap->start = NULL;
126 heap->bytes_remaining = 0;
280 _XtHeapAlloc(Heap *heap, Cardinal bytes)
284 if (heap == NULL)
286 if (heap->bytes_remaining < (int) bytes) {
290 printf("allocating large segment (%d bytes) on heap %p\n",
291 bytes, heap);
294 if (heap->start) {
295 *(char **) heap_loc = *(char **) heap->start;
296 *(char **) heap->start = heap_loc;
300 heap->start = heap_loc;
306 printf("allocating new segment on heap %p\n", heap);
309 *(char **) heap_loc = heap->start;
310 heap->start = heap_loc;
311 heap->current = heap_loc + sizeof(char *);
312 heap->bytes_remaining = HEAP_SEGMENT_SIZE - sizeof(char *);
315 heap_loc = heap->current;
316 heap->current += bytes;
317 heap->bytes_remaining = (heap->bytes_remaining - (int) bytes); /* can be negative, if rounded */
322 _XtHeapFree(Heap *heap)
324 char *segment = heap->start;
332 heap->start = NULL;
333 heap->bytes_remaining = 0;
354 XtPointer heap;
375 ptr->heap = hp; \
528 _XtHeapMalloc(Heap *heap, Cardinal size, const char *file, int line)
532 XtPointer hp = (XtPointer) heap;
546 _XtHeapFree(Heap *heap)
553 if (mem->heap == heap) {
586 mem->file, mem->line, mem->heap ? "heap" : "");