Skip to content

Commit

Permalink
Move constructor impls to cpp file
Browse files Browse the repository at this point in the history
  • Loading branch information
jerboaa committed Aug 27, 2024
1 parent 2bb83c3 commit b8c288a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
16 changes: 16 additions & 0 deletions src/hotspot/os/linux/cgroupV2Subsystem_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,22 @@
#include "cgroupV2Subsystem_linux.hpp"
#include "cgroupUtil_linux.hpp"

// Constructor
CgroupV2Controller::CgroupV2Controller(char* mount_path,
char *cgroup_path,
bool ro) : _read_only(ro),
_path(construct_path(mount_path, cgroup_path)) {
_cgroup_path = os::strdup(cgroup_path);
_mount_point = os::strdup(mount_path);
}
// Shallow copy constructor
CgroupV2Controller::CgroupV2Controller(const CgroupV2Controller& o) :
_read_only(o._read_only),
_path(o._path) {
_cgroup_path = o._cgroup_path;
_mount_point = o._mount_point;
}

/* cpu_shares
*
* Return the amount of cpu shares available to the process
Expand Down
15 changes: 2 additions & 13 deletions src/hotspot/os/linux/cgroupV2Subsystem_linux.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,9 @@ class CgroupV2Controller: public CgroupController {
static char* construct_path(char* mount_path, const char *cgroup_path);

public:
CgroupV2Controller(char* mount_path,
char *cgroup_path,
bool ro) : _read_only(ro),
_path(construct_path(mount_path, cgroup_path)) {
_cgroup_path = os::strdup(cgroup_path);
_mount_point = os::strdup(mount_path);
}
CgroupV2Controller(char* mount_path, char *cgroup_path, bool ro);
// Shallow copy constructor
CgroupV2Controller(const CgroupV2Controller& o) :
_read_only(o._read_only),
_path(o._path) {
_cgroup_path = o._cgroup_path;
_mount_point = o._mount_point;
}
CgroupV2Controller(const CgroupV2Controller& o);
~CgroupV2Controller() {
// At least one controller exists with references to the paths
}
Expand Down

0 comments on commit b8c288a

Please sign in to comment.