My Project
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Data Fields
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.

1664 : rc(init) {
1665 }

Member Function Documentation

◆ dec()

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

Definition at line 1672 of file vspace.h.

1672 {
1673 lock(vaddr);
1674 std::ptrdiff_t result = --rc;
1675 unlock(vaddr);
1676 return result;
1677 }
return result
Definition: facAbsBiFact.cc:75
static void lock(vaddr_t vaddr)
Definition: vspace.h:1658
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.

1666 {
1667 lock(vaddr);
1668 std::ptrdiff_t result = ++rc;
1669 unlock(vaddr);
1670 return result;
1671 }

◆ lock()

static void vspace::internals::refcount_t::lock ( vaddr_t  vaddr)
inlinestatic

Definition at line 1658 of file vspace.h.

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

◆ unlock()

static void vspace::internals::refcount_t::unlock ( vaddr_t  vaddr)
inlinestatic

Definition at line 1661 of file vspace.h.

1661 {
1663 }
void unlock_file(int fd, size_t offset, size_t len)
Definition: vspace.cc:873

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: