Skip to content

Commit

Permalink
Merge branch 'master' into fix-alloc
Browse files Browse the repository at this point in the history
  • Loading branch information
andarut committed Jul 15, 2023
2 parents 484433f + 1dca9af commit 17816d2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 25 deletions.
21 changes: 0 additions & 21 deletions common/type_traits/is_copyable.h

This file was deleted.

6 changes: 3 additions & 3 deletions server/job-workers/pipe-io.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include <climits>
#include <cstdint>
#include "common/type_traits/is_copyable.h"
#include <type_traits>

namespace job_workers {

Expand All @@ -24,13 +24,13 @@ class PipeIO {

PipeIO() = default;

template<typename T, typename = typename std::enable_if<vk::is_trivially_copyable<T>::value>::type>
template<typename T, typename = typename std::enable_if<std::is_trivially_copyable<T>::value>::type>
void copy_to_buffer(T x) {
memcpy(buf + buf_end_pos, &x, sizeof(T));
buf_end_pos += sizeof(T);
}

template<typename T, typename = typename std::enable_if<vk::is_trivially_copyable<T>::value>::type>
template<typename T, typename = typename std::enable_if<std::is_trivially_copyable<T>::value>::type>
void extract_from_buffer(T &dest) {
memcpy(&dest, buf, sizeof(T));
}
Expand Down
2 changes: 1 addition & 1 deletion tests/python/tests/http_server/test_oom_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,6 @@ def test_timeout_in_oom_handler(self):
self.assertEqual(resp.status_code, 500)
self.kphp_server.assert_log([
"allocations_cnt=[1-9]\\d?,memory_allocated=8\\d{5},estimate_memory_usage\\(arr\\)=8\\d{5}",
"Warning: Can't allocate \\d+ bytes",
# "Warning: Can't allocate \\d+ bytes",
"timeout exit",
], timeout=5)

0 comments on commit 17816d2

Please sign in to comment.