File: create.cc

package info (click to toggle)
bobcat 6.02.02-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 13,960 kB
  • sloc: cpp: 18,954; fortran: 5,617; makefile: 2,787; sh: 659; perl: 401; ansic: 26
file content (14 lines) | stat: -rw-r--r-- 414 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include "sharedsegment.ih"

SharedSegment *SharedSegment::create(int *id,
                                     size_t nBlocks, size_t segmentSize,
                                     size_t access)
{
    *id = newSegment(segmentSize, access);

    SharedSegment *segmentPtr = static_cast<SharedSegment *>(attach(*id));

    new (segmentPtr) SharedSegment(access, nBlocks, segmentSize);

    return segmentPtr;
}