memalloc.c File Reference

#include "common.h"
#include <stdio.h>
#include "machine.h"
#include "vmath.h"
#include "raytrace.h"

Include dependency graph for memalloc.c:

Go to the source code of this file.

Defines

#define M_TMTCH   00001
#define M_BMTCH   00002
#define M_TOVFL   00004
#define M_BOVFL   00010

Functions

unsigned long rt_memalloc (struct mem_map **pp, register unsigned int size)
mem_maprt_memalloc_nosplit (struct mem_map **pp, register unsigned int size)
unsigned long rt_memget (struct mem_map **pp, register unsigned int size, unsigned int place)
unsigned long rt_memget_nosplit (struct mem_map **pp, register unsigned int size, unsigned int place)
void rt_memfree (struct mem_map **pp, unsigned int size, long unsigned int addr)
void rt_mempurge (struct mem_map **pp)
void rt_memprint (struct mem_map **pp)
void rt_memclose (void)


Detailed Description

Functions - rt_memalloc allocate 'size' of memory from a given map rt_memget allocate 'size' of memory from map at 'place' rt_memfree return 'size' of memory to map at 'place' rt_mempurge free everything on current memory chain rt_memprint print a map rt_memclose

The structure of the displaylist memory map chains consists of non-zero count and base address of that many contiguous units. The addresses are increasing and the list is terminated with the first zero link.

rt_memalloc() and rt_memfree() use these tables to allocate displaylist memory.

For each Memory Map there exists a queue (coremap). There also exists a queue of free buffers which are enqueued on to either of the previous queues. Initially all of the buffers are placed on the `freemap' queue. Whenever a buffer is freed because of coallescing ends in rt_memfree() or zero size in rt_memalloc() the mapping buffer is taken off from the respective queue and returned to the `freemap' queue.

Authors - George E. Toth Michael John Muuss

Source - SECAD/VLD Computing Consortium, Bldg 394 The U. S. Army Ballistic Research Laboratory Aberdeen Proving Ground, Maryland 21005

Definition in file memalloc.c.


Define Documentation

#define M_TMTCH   00001
 

Definition at line 79 of file memalloc.c.

Referenced by rt_memfree().

#define M_BMTCH   00002
 

Definition at line 80 of file memalloc.c.

Referenced by rt_memfree().

#define M_TOVFL   00004
 

Definition at line 81 of file memalloc.c.

Referenced by rt_memfree().

#define M_BOVFL   00010
 

Definition at line 82 of file memalloc.c.

Referenced by rt_memfree().


Function Documentation

unsigned long rt_memalloc struct mem_map **  pp,
register unsigned int  size
 

Definition at line 97 of file memalloc.c.

References mem_map::m_addr, mem_map::m_nxtp, mem_map::m_size, and MAP_NULL.

struct mem_map* rt_memalloc_nosplit struct mem_map **  pp,
register unsigned int  size
 

Definition at line 144 of file memalloc.c.

References mem_map::m_nxtp, mem_map::m_size, and MAP_NULL.

unsigned long rt_memget struct mem_map **  pp,
register unsigned int  size,
unsigned int  place
 

Definition at line 192 of file memalloc.c.

References mem_map::m_addr, mem_map::m_nxtp, mem_map::m_size, MAP_NULL, and rt_bomb().

Here is the call graph for this function:

unsigned long rt_memget_nosplit struct mem_map **  pp,
register unsigned int  size,
unsigned int  place
 

Definition at line 245 of file memalloc.c.

References bu_bomb(), mem_map::m_addr, mem_map::m_nxtp, mem_map::m_size, and MAP_NULL.

Here is the call graph for this function:

void rt_memfree struct mem_map **  pp,
unsigned int  size,
long unsigned int  addr
 

Definition at line 291 of file memalloc.c.

References BU_FLSTR, bu_log(), bu_malloc(), mem_map::m_addr, M_BMTCH, M_BOVFL, mem_map::m_nxtp, mem_map::m_size, M_TMTCH, M_TOVFL, MAP_NULL, and type.

Here is the call graph for this function:


Generated on Mon Sep 18 01:25:07 2006 for BRL-CAD by  doxygen 1.4.6