Graphviz 12.0.1~dev.20240716.0800
Loading...
Searching...
No Matches
memory.c File Reference
#include <cgraph/alloc.h>
#include <neatogen/geometry.h>
#include <common/render.h>
#include <neatogen/mem.h>
#include <stdlib.h>
#include <stdio.h>
Include dependency graph for memory.c:

Go to the source code of this file.

Data Structures

struct  freenode
 
struct  freeblock
 

Macros

#define LCM(x, y)   ((x)%(y) == 0 ? (x) : (y)%(x) == 0 ? (y) : x*(y/gcd(x,y)))
 

Typedefs

typedef struct freenode Freenode
 
typedef struct freeblock Freeblock
 

Functions

static int gcd (int y, int x)
 
void freeinit (Freelist *fl, int size)
 
void * getfree (Freelist *fl)
 
void makefree (void *curr, Freelist *fl)
 

Macro Definition Documentation

◆ LCM

#define LCM (   x,
 
)    ((x)%(y) == 0 ? (x) : (y)%(x) == 0 ? (y) : x*(y/gcd(x,y)))

Definition at line 39 of file memory.c.

Typedef Documentation

◆ Freeblock

typedef struct freeblock Freeblock

◆ Freenode

typedef struct freenode Freenode

Function Documentation

◆ freeinit()

void freeinit ( Freelist fl,
int  size 
)

Definition at line 41 of file memory.c.

References freelist::blocklist, free(), freelist::head, LCM, freeblock::next, freeblock::nodes, freelist::nodesize, and NULL.

Referenced by edgeinit(), ELcleanup(), ELinitialize(), infoinit(), and siteinit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gcd()

static int gcd ( int  y,
int  x 
)
static

Definition at line 28 of file memory.c.

◆ getfree()

void * getfree ( Freelist fl)

Definition at line 60 of file memory.c.

References freelist::blocklist, gv_alloc(), gv_calloc(), freelist::head, makefree(), freeblock::next, freenode::nextfree, freeblock::nodes, freelist::nodesize, NULL, and sqrt_nsites.

Referenced by addVertex(), getsite(), gvbisect(), and HEcreate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ makefree()

void makefree ( void *  curr,
Freelist fl 
)

Definition at line 83 of file memory.c.

References freelist::head, and freenode::nextfree.

Referenced by deref(), ELgethash(), endpoint(), and getfree().

Here is the caller graph for this function: