Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: disable mimalloc on linux with aarch64 #69

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 20, 2025
Merged

Conversation

JounQin
Copy link
Member

@JounQin JounQin commented Apr 20, 2025

close #64

close import-js/eslint-import-resolver-typescript#406


Important

Disable mimalloc on Linux with aarch64 in napi/src/lib.rs due to allocator issues.

This description was created by Ellipsis for 10f555d. You can customize this summary. It will automatically update as commits are pushed.


Summary by CodeRabbit

  • Chores
    • Updated internal configuration to improve compatibility on certain Linux devices. No visible changes to app features or functionality.

@JounQin JounQin requested a review from Copilot April 20, 2025 07:06
Copy link

coderabbitai bot commented Apr 20, 2025

Walkthrough

The change updates the global memory allocator configuration in the napi/src/lib.rs file. Specifically, it adds a new conditional exclusion so that the mimalloc_safe::MiMalloc allocator is not used when compiling for the aarch64 architecture on Linux. Previously, this allocator was only excluded for ARM, FreeBSD, and WebAssembly targets. No other code or logic is affected by this change.

Changes

File(s) Change Summary
napi/src/lib.rs Updated the conditional compilation attributes to further exclude Linux aarch64 from using the mimalloc_safe::MiMalloc global allocator.

Sequence Diagram(s)

sequenceDiagram
    participant Build
    participant AllocatorConfig
    participant MiMalloc

    Build->>AllocatorConfig: Compile napi/src/lib.rs
    AllocatorConfig->>AllocatorConfig: Check target architecture and OS
    alt Not ARM/FreeBSD/WASM/Linux aarch64
        AllocatorConfig->>MiMalloc: Set MiMalloc as global allocator
    else
        AllocatorConfig->>AllocatorConfig: Use default allocator
    end
Loading

Assessment against linked issues

Objective Addressed Explanation
Prevent illegal instruction error on Raspberry Pi 4 aarch64 by excluding MiMalloc (#64) βœ…

Poem

A hop and a skip, a change in the heap,
For aarch64 on Linux, MiMalloc won’t creep.
No more illegal instructions to make you frown,
Raspberry Pi 4 will no longer go down!
With allocators tamed, our code runs freeβ€”
A bunny’s delight in compatibility! πŸ‡βœ¨


πŸ“œ Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between cf496e2 and 10f555d.

πŸ“’ Files selected for processing (1)
  • napi/src/lib.rs (1 hunks)
βœ… Files skipped from review due to trivial changes (1)
  • napi/src/lib.rs
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Test (windows-latest)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❀️ Share
πŸͺ§ Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR disables mimalloc on Linux with aarch64 to address issues reported in #64.

  • Updated the conditional compilation attribute in napi/src/lib.rs to exclude Linux aarch64 from using mimalloc.

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Looks good to me! πŸ‘

Reviewed everything up to cf496e2 in 30 seconds. Click for details.
  • Reviewed 15 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with πŸ‘ or πŸ‘Ž to teach Ellipsis.
1. napi/src/lib.rs:5
  • Draft comment:
    Consider adding an inline comment explaining why mimalloc is disabled for Linux AArch64 (e.g., Raspberry PI incompatibility) to aid future maintainability.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50% None
2. napi/src/lib.rs:1
  • Draft comment:
    Good fix. Consider adding an inline comment explaining that mimalloc is disabled on Linux aarch64 (per issue Illegal instruction error - Raspberry PI 4 aarch64Β #64) to aid future maintainers.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None

Workflow ID: wflow_KDUI4jn79C42eJY0

You can customize Ellipsis by changing your verbosity settings, reacting with πŸ‘ or πŸ‘Ž, replying to comments, or adding code review rules.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

πŸ“œ Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 8772685 and cf496e2.

πŸ“’ Files selected for processing (1)
  • napi/src/lib.rs (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Test (windows-latest)

@JounQin JounQin force-pushed the fix/linux_aarch64 branch from cf496e2 to 10f555d Compare April 20, 2025 07:12
Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Looks good to me! πŸ‘

Reviewed 10f555d in 24 seconds. Click for details.
  • Reviewed 16 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with πŸ‘ or πŸ‘Ž to teach Ellipsis.
1. napi/src/lib.rs:2
  • Draft comment:
    The cfg condition correctly disables mimalloc on ARM, FreeBSD, WASM, and Linux/aarch64 as intended in Illegal instruction error - Raspberry PI 4 aarch64Β #64. No issues detected.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None
2. napi/src/lib.rs:1
  • Draft comment:
    The new cfg condition correctly disables mimalloc on Linux/aarch64. Ensure tests cover this target.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50% None

Workflow ID: wflow_bUgtT2qvmYKukHts

You can customize Ellipsis by changing your verbosity settings, reacting with πŸ‘ or πŸ‘Ž, replying to comments, or adding code review rules.

@JounQin JounQin merged commit 12dca0c into main Apr 20, 2025
14 checks passed
@JounQin JounQin deleted the fix/linux_aarch64 branch April 20, 2025 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant