Skip to content

Commit

Permalink
fix: hide mlock warning
Browse files Browse the repository at this point in the history
  • Loading branch information
b4rtaz committed Feb 13, 2025
1 parent b5283f7 commit 5ce3c19
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/nn/nn-cpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#define DEBUG_CPU_OP_QUANTS false

#define BUFFER_ALIGNMENT 16
#define BUFFER_ALIGNMENT 64

static NnByte *allocAlignedBuffer(size_t size) {
NnByte *buffer;
Expand All @@ -25,8 +25,7 @@ static NnByte *allocAlignedBuffer(size_t size) {
#else
if (posix_memalign((void **)&buffer, BUFFER_ALIGNMENT, size) != 0)
throw std::runtime_error("posix_memalign failed");
if (mlock(buffer, size) != 0)
fprintf(stderr, "🚧 Cannot allocate %zu bytes directly in RAM\n", size);
mlock(buffer, size);
#endif
return buffer;
}
Expand Down

0 comments on commit 5ce3c19

Please sign in to comment.