Skip to content
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

实现mmap参数化 #49

Open
WangTingZheng opened this issue Jul 30, 2023 · 2 comments
Open

实现mmap参数化 #49

WangTingZheng opened this issue Jul 30, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@WangTingZheng
Copy link
Owner

WangTingZheng commented Jul 30, 2023

老是改kDefaultMmapLimit不太好,这个是在编译期就计算出来的。

@WangTingZheng WangTingZheng added the enhancement New feature or request label Jul 30, 2023
@WangTingZheng WangTingZheng changed the title 关闭mmap参数化 实现mmap参数化 Jul 30, 2023
@WangTingZheng
Copy link
Owner Author

env_posix_test_helper.h里的EnvPosixTestHelper可以用一下:

// A helper for the POSIX Env to facilitate testing.
class EnvPosixTestHelper {
 private:
  friend class EnvPosixTest;

  // Set the maximum number of read-only files that will be opened.
  // Must be called before creating an Env.
  static void SetReadOnlyFDLimit(int limit);

  // Set the maximum number of read-only files that will be mapped via mmap.
  // Must be called before creating an Env.
  static void SetReadOnlyMMapLimit(int limit);
};

@WangTingZheng
Copy link
Owner Author

WangTingZheng commented Jul 30, 2023

发现很难,必须在Env创建前就需要改值,可以从NewRandomAccessFile入手。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: In progress
Development

No branches or pull requests

1 participant