NetSurf
Enumerations | Functions | Variables
memory.c File Reference
#include <proto/dos.h>
#include <proto/exec.h>
#include <exec/interrupts.h>
#include <stdlib.h>
#include "amiga/memory.h"
#include "amiga/os3support.h"
#include "amiga/schedule.h"
#include "content/llcache.h"
#include "utils/log.h"
Include dependency graph for memory.c:

Go to the source code of this file.

Enumerations

enum  {
  PURGE_NONE = 0 , PURGE_STEP1 , PURGE_STEP2 , PURGE_DONE_STEP1 ,
  PURGE_DONE_STEP2
}
 

Functions

void * ami_memory_clear_alloc (size_t size, UBYTE value)
 
static int ami_memory_slab_usage_cb (const struct __slab_usage_information *sui)
 
static int ami_memory_slab_alloc_cb (const struct __slab_allocation_information *sai)
 
static int ami_memory_slab_stats_cb (void *user_data, const char *line, size_t line_length)
 
void ami_memory_slab_dump (BPTR fh)
 
static void ami_memory_low_mem_handler (void *p)
 
static ASM ULONG ami_memory_handler (REG(a0, struct MemHandlerData *mhd), REG(a1, void *userdata), REG(a6, struct ExecBase *execbase))
 
struct Interrupt * ami_memory_init (void)
 
void ami_memory_fini (struct Interrupt *memhandler)
 

Variables

ULONG __slab_max_size = 2048
 
static int low_mem_status = PURGE_NONE
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
PURGE_NONE 
PURGE_STEP1 
PURGE_STEP2 
PURGE_DONE_STEP1 
PURGE_DONE_STEP2 

Definition at line 32 of file memory.c.

Function Documentation

◆ ami_memory_clear_alloc()

void * ami_memory_clear_alloc ( size_t  size,
UBYTE  value 
)

Definition at line 42 of file memory.c.

Referenced by amiga_bitmap_create().

Here is the caller graph for this function:

◆ ami_memory_fini()

void ami_memory_fini ( struct Interrupt *  memhandler)

Definition at line 179 of file memory.c.

Referenced by main().

Here is the caller graph for this function:

◆ ami_memory_handler()

static ASM ULONG ami_memory_handler ( REG(a0, struct MemHandlerData *mhd)  ,
REG(a1, void *userdata)  ,
REG(a6, struct ExecBase *execbase)   
)
static

Definition at line 145 of file memory.c.

References ami_memory_low_mem_handler(), ami_schedule(), low_mem_status, PURGE_DONE_STEP1, PURGE_DONE_STEP2, PURGE_NONE, PURGE_STEP1, and PURGE_STEP2.

Referenced by ami_memory_init().

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

◆ ami_memory_init()

struct Interrupt * ami_memory_init ( void  )

Definition at line 165 of file memory.c.

References ami_memory_handler().

Referenced by main().

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

◆ ami_memory_low_mem_handler()

static void ami_memory_low_mem_handler ( void *  p)
static

Definition at line 130 of file memory.c.

References llcache_clean(), low_mem_status, NSLOG, PURGE_DONE_STEP1, PURGE_DONE_STEP2, PURGE_STEP1, and PURGE_STEP2.

Referenced by ami_memory_handler().

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

◆ ami_memory_slab_alloc_cb()

static int ami_memory_slab_alloc_cb ( const struct __slab_allocation_information *  sai)
static

Definition at line 89 of file memory.c.

References NSLOG.

Referenced by ami_memory_slab_dump().

Here is the caller graph for this function:

◆ ami_memory_slab_dump()

void ami_memory_slab_dump ( BPTR  fh)

Definition at line 122 of file memory.c.

References ami_memory_slab_alloc_cb(), ami_memory_slab_stats_cb(), and ami_memory_slab_usage_cb().

Referenced by RXHOOKF().

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

◆ ami_memory_slab_stats_cb()

static int ami_memory_slab_stats_cb ( void *  user_data,
const char *  line,
size_t  line_length 
)
static

Definition at line 110 of file memory.c.

References line().

Referenced by ami_memory_slab_dump().

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

◆ ami_memory_slab_usage_cb()

static int ami_memory_slab_usage_cb ( const struct __slab_usage_information *  sui)
static

Definition at line 50 of file memory.c.

References NSLOG.

Referenced by ami_memory_slab_dump().

Here is the caller graph for this function:

Variable Documentation

◆ __slab_max_size

ULONG __slab_max_size = 2048

Definition at line 30 of file memory.c.

◆ low_mem_status

int low_mem_status = PURGE_NONE
static

Definition at line 39 of file memory.c.

Referenced by ami_memory_handler(), and ami_memory_low_mem_handler().