Loading...
Searching...
No Matches
vspace::internals::refcount_t Struct Reference

`#include <vspace.h>`

## Public Member Functions

| refcount_t (std::ptrdiff_t init)
std::ptrdiff_t | inc (vaddr_t vaddr)
std::ptrdiff_t | dec (vaddr_t vaddr)

## Static Public Member Functions

static void | lock (vaddr_t vaddr)
static void | unlock (vaddr_t vaddr)

## Data Fields

std::ptrdiff_t | rc

## Detailed Description

Definition at line 1656 of file vspace.h.

## Constructor & Destructor Documentation

## refcount_t()

vspace::internals::refcount_t::refcount_t | ( | std::ptrdiff_t | init | ) |

inline

Definition at line 1664 of file vspace.h.

: rc(init) {
}
vspace::internals::refcount_t::rc
std::ptrdiff_t rc
Definition vspace.h:1657

## Member Function Documentation

## dec()

std::ptrdiff_t vspace::internals::refcount_t::dec | ( | vaddr_t | vaddr | ) |

inline

Definition at line 1672 of file vspace.h.

{
lock(vaddr);
std::ptrdiff_t result = --rc;
unlock(vaddr);
return result;
}
result
return result
Definition facAbsBiFact.cc:76
vspace::internals::refcount_t::lock
static void lock(vaddr_t vaddr)
Definition vspace.h:1658
vspace::internals::refcount_t::unlock
static void unlock(vaddr_t vaddr)
Definition vspace.h:1661

## inc()

std::ptrdiff_t vspace::internals::refcount_t::inc | ( | vaddr_t | vaddr | ) |

inline

Definition at line 1666 of file vspace.h.

{
lock(vaddr);
std::ptrdiff_t result = ++rc;
unlock(vaddr);
return result;
}

## lock()

void vspace::internals::refcount_t::lock | ( | vaddr_t | vaddr | ) |

inline static

Definition at line 1658 of file vspace.h.

{
lock_file(vmem.fd, METABLOCK_SIZE + vaddr);
}
vspace::internals::lock_file
void lock_file(int fd, size_t offset, size_t len)
Definition vspace.cc:913
vspace::internals::METABLOCK_SIZE
static const size_t METABLOCK_SIZE
Definition vspace.h:1420
vspace::internals::vmem
static VMem & vmem
Definition vspace.h:1635
vspace::internals::VMem::fd
int fd
Definition vspace.h:1590

## unlock()

void vspace::internals::refcount_t::unlock | ( | vaddr_t | vaddr | ) |

inline static

Definition at line 1661 of file vspace.h.

{
unlock_file(vmem.fd, METABLOCK_SIZE + vaddr);
}
vspace::internals::unlock_file
void unlock_file(int fd, size_t offset, size_t len)
Definition vspace.cc:919

## Field Documentation

## rc

std::ptrdiff_t vspace::internals::refcount_t::rc

Definition at line 1657 of file vspace.h.

The documentation for this struct was generated from the following file:

- kernel/oswrapper/vspace.h