MCPcopy Create free account
hub / github.com/Singular/Singular / add_segment

Method add_segment

kernel/oswrapper/vspace.cc:112–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110}
111
112void VMem::add_segment() {
113 int seg = metapage->segment_count++;
114 ftruncate(fd, METABLOCK_SIZE + metapage->segment_count * SEGMENT_SIZE);
115 void *map_addr = mmap_segment(seg);
116 segments[seg] = VSeg(map_addr);
117 Block *top = block_ptr(seg * SEGMENT_SIZE);
118 top->next = freelist[LOG2_SEGMENT_SIZE];
119 top->prev = VADDR_NULL;
120 freelist[LOG2_SEGMENT_SIZE] = seg * SEGMENT_SIZE;
121}
122
123void FastLock::lock() {
124#ifdef HAVE_CPP_THREADS

Callers 1

vmem_allocFunction · 0.80

Calls 2

VSegClass · 0.85
block_ptrFunction · 0.85

Tested by

no test coverage detected