gCAD3D 2.40
ut_umb.c File Reference

memoryblocks (malloc, free, .. UMB_) More...

#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "../ut/ut_umem.h"
#include "../ut/ut_umb.h"
#include "../ut/ut_TX.h"

Data Structures

struct  umb_stru


#define UMB_MAX_ID   255


int UMB_is_alive (int id)
int UMB_reserve__ (int *actId)
int UME_reuse (int actId)
int UMB_reload (int *recNr, void *pStart, void **pNxt, void *pEnd, int ii)
int UMB_save (int mbId, void *memPos, long memSiz, int recNr)
int UMB_stat__ (int mbId)
void * UMB_pos__ (int mbId)
int UMB_free (int mbId)
int UMB_dump__ ()


static int umbNr = 0
static int umbSiz = 0
static int umbIncSiz = 100
static umb_struumbTab = NULL
static int umbId = -1

Detailed Description

memoryblocks (malloc, free, .. UMB_)

UMB_reserve__ reserve a memoryblockId;
UMB_pos__ get startpos of saved memblock
UMB_save copy a local memoryblock (malloc, memcpy)
UMB_free free memoryblock from memoryblockId
UMB_is_alive check if blockId is active / valid
UMB_reload reload memBlock ii; update pNxt
UME_reuse increment blockId
- see also:
../doc/gCAD3D_prog_de.txt section Memoryfunktionen

Macro Definition Documentation

#define UMB_MAX_ID   255

Function Documentation

int UMB_is_alive ( int  id)
* check if blockId <id> is active / valid
* 0=no, 1=yes
int UMB_reserve__ ( int *  actId)
int UME_reuse ( int  actId)

increment blockId

int UMB_reload ( int *  recNr,
void *  pStart,
void **  pNxt,
void *  pEnd,
int  ii 

reload memBlock ii; update pNxt

int UMB_save ( int  mbId,
void *  memPos,
long  memSiz,
int  recNr 
* save a memblock (malloc & memcpy);
* set its umbStat to 2.
int UMB_stat__ ( int  mbId)
void* UMB_pos__ ( int  mbId)
* get startpos of memblock <mbId>
* NULL if memblock not reserved or not yet saved ..
int UMB_free ( int  mbId)

delete a memoryblock

int UMB_dump__ ( )

dump table of memoryblocks

Variable Documentation

int umbNr = 0
int umbSiz = 0
int umbIncSiz = 100
umb_stru* umbTab = NULL
int umbId = -1