Skip to content

Commit 0f1eebb

Browse files
Copilotevilsocket
andauthored
fix: replace posix_madvise/POSIX_MADV_WILLNEED in disk_expert_provider.rs for Android compat
Agent-Logs-Url: https://github.com/evilsocket/cake/sessions/8c7587c9-58e7-4276-80dd-82a6b595cbef Co-authored-by: evilsocket <86922+evilsocket@users.noreply.github.com>
1 parent e58cb3a commit 0f1eebb

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

cake-core/src/models/common/disk_expert_provider.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -511,10 +511,10 @@ impl ExpertProvider for DiskExpertProvider {
511511
for name in [&names.gate_proj, &names.up_proj, &names.down_proj] {
512512
if let Some((bytes, _, _)) = self.storage.tensor_bytes(name) {
513513
unsafe {
514-
libc::posix_madvise(
515-
bytes.as_ptr() as *mut _,
514+
libc::madvise(
515+
bytes.as_ptr() as *mut libc::c_void,
516516
bytes.len(),
517-
libc::POSIX_MADV_WILLNEED,
517+
libc::MADV_WILLNEED,
518518
);
519519
}
520520
}

0 commit comments

Comments
 (0)