mincore 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/mincore.rb +12 -4
  2. metadata +3 -3
data/lib/mincore.rb CHANGED
@@ -1,11 +1,10 @@
1
1
  require 'inline'
2
2
 
3
-
3
+ # The File mincore extension
4
4
  class File
5
5
 
6
-
7
- inline do |builder|
8
-
6
+ # get pagesize (4096 on Intel)
7
+ inline do |builder|
9
8
  builder.c_raw_singleton "
10
9
  static VALUE PAGESIZE(int argc, VALUE *argv, VALUE self) {
11
10
  int size = getpagesize();
@@ -146,6 +145,15 @@ static VALUE _cachedel(char *filename, int count) {
146
145
  C_CODE
147
146
  end
148
147
 
148
+ # Attempts to delete cached pages of a file, one or more times
149
+ #
150
+ # Example:
151
+ # >> File.cachedel("/path/to/useless/file", 2)
152
+ # => 0
153
+ #
154
+ # Arguments:
155
+ # filename: (String)
156
+ # count: (Int)
149
157
  def self.cachedel(filename, count=1)
150
158
  self._cachedel(filename, count)
151
159
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mincore
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 3
10
- version: 0.0.3
9
+ - 4
10
+ version: 0.0.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Reda NOUSHI