posix_mq 0.3.0 → 0.3.1

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.
data/ChangeLog CHANGED
@@ -1,5 +1,43 @@
1
1
  ChangeLog from git://git.bogomips.org/ruby_posix_mq.git ()
2
2
 
3
+ commit 05e577616b74bea99a0e43e07f28823ddda1aaf9
4
+ Author: Eric Wong <normalperson@yhbt.net>
5
+ Date: Sat Feb 13 03:39:17 2010 -0800
6
+
7
+ posix_mq 0.3.1
8
+
9
+ This fixes a misuse of the Ruby API leading to memory leaks in
10
+ cases where message queues are continually opened and closed
11
+ throughout the lifetime of the application.
12
+
13
+ Fortunately applications have little reason to repeatedly open
14
+ and close message queue descriptors: they are
15
+ multi-thread/multi-process-safe in every way imaginable and also
16
+ capable of non-blocking operation.
17
+
18
+ commit 9adbee0ab71bf408db5c3befb43b2bab0d86ebb2
19
+ Author: Eric Wong <normalperson@yhbt.net>
20
+ Date: Sat Feb 13 03:30:44 2010 -0800
21
+
22
+ use GC correctly and avoid memory leaks
23
+
24
+ We still need to explicitly free the pointer we're given, and
25
+ not just close the associated file descriptor. Fortunately most
26
+ people to not spend all day opening/closing message queue
27
+ descriptors so this leak may not be noticeable.
28
+
29
+ commit c07cf2979036b9550566d59d6d4899be98f3e553
30
+ Author: Eric Wong <normalperson@yhbt.net>
31
+ Date: Thu Jan 21 20:44:22 2010 -0800
32
+
33
+ add #shift test with destination buffer
34
+
35
+ commit 1d0bf6f1d39e085948008c2c6d381ed929ac109e
36
+ Author: Eric Wong <normalperson@yhbt.net>
37
+ Date: Sat Jan 9 15:16:40 2010 -0800
38
+
39
+ Rakefile: fix raa_update task
40
+
3
41
  commit 2e420820d3b3fb228c810937539f95a618a2c271
4
42
  Author: Eric Wong <normalperson@yhbt.net>
5
43
  Date: Sat Jan 9 22:52:27 2010 +0000
data/GIT-VERSION-FILE CHANGED
@@ -1 +1 @@
1
- GIT_VERSION = 0.3.0
1
+ GIT_VERSION = 0.3.1
data/GIT-VERSION-GEN CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/bin/sh
2
2
 
3
3
  GVF=GIT-VERSION-FILE
4
- DEF_VER=v0.3.0.GIT
4
+ DEF_VER=v0.3.1.GIT
5
5
 
6
6
  LF='
7
7
  '
data/NEWS CHANGED
@@ -1,3 +1,14 @@
1
+ === 0.3.1 / 2010-02-13 12:05 UTC
2
+
3
+ This fixes a misuse of the Ruby API leading to memory leaks in
4
+ cases where message queues are continually opened and closed
5
+ throughout the lifetime of the application.
6
+
7
+ Fortunately applications have little reason to repeatedly open
8
+ and close message queue descriptors: they are
9
+ multi-thread/multi-process-safe in every way imaginable and also
10
+ capable of non-blocking operation.
11
+
1
12
  === 0.3.0 / 2010-01-09 23:11 UTC
2
13
 
3
14
  This release adds a few new API methods, fixes MRI 1.8.6
data/Rakefile CHANGED
@@ -125,7 +125,7 @@ task :raa_update do
125
125
  require 'rubygems'
126
126
  require 'net/http'
127
127
  require 'net/netrc'
128
- rc = Net::Netrc.locate('ruby_posix_mq-raa') or abort "~/.netrc not found"
128
+ rc = Net::Netrc.locate('posix_mq-raa') or abort "~/.netrc not found"
129
129
  password = rc.password
130
130
 
131
131
  s = Gem::Specification.load('posix_mq.gemspec')
@@ -147,7 +147,7 @@ task :raa_update do
147
147
  :category_minor => 'System',
148
148
  :url => s.homepage,
149
149
  :download => 'http://rubyforge.org/frs/?group_id=5626',
150
- :license => 'LGPLv3',
150
+ :license => 'LGPL', # LGPLv3, actually, but RAA is ancient...
151
151
  :description_style => 'Plain',
152
152
  :description => desc,
153
153
  :pass => password,
@@ -216,8 +216,8 @@ static void _free(void *ptr)
216
216
 
217
217
  mq_close(mq->des);
218
218
  errno = saved_errno;
219
- mq->des = MQD_INVALID;
220
219
  }
220
+ xfree(ptr);
221
221
  }
222
222
 
223
223
  /* automatically called at creation (before initialize) */
data/lib/posix_mq.rb CHANGED
@@ -1,8 +1,8 @@
1
1
  # -*- encoding: binary -*-
2
2
  class POSIX_MQ
3
3
 
4
- # version of POSIX_MQ, currently 0.3.0
5
- VERSION = '0.3.0'
4
+ # version of POSIX_MQ, currently 0.3.1
5
+ VERSION = '0.3.1'
6
6
 
7
7
  # An analogous Struct to "struct mq_attr" in C.
8
8
  # This may be used in arguments for POSIX_MQ.new and
@@ -96,6 +96,14 @@ class Test_POSIX_MQ < Test::Unit::TestCase
96
96
  assert_equal "hello", @mq.shift
97
97
  end
98
98
 
99
+ def test_shift_buf
100
+ buf = ""
101
+ @mq = POSIX_MQ.new @path, IO::CREAT|IO::RDWR, 0666
102
+ @mq << "hello"
103
+ assert_equal "hello", @mq.shift(buf)
104
+ assert_equal "hello", buf
105
+ end
106
+
99
107
  def test_send_receive
100
108
  @mq = POSIX_MQ.new @path, IO::CREAT|IO::RDWR, 0666
101
109
  assert_nil @mq.send("hello", 0)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: posix_mq
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ruby POSIX MQ hackers
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-01-09 00:00:00 +00:00
12
+ date: 2010-02-13 00:00:00 +00:00
13
13
  default_executable:
14
14
  dependencies: []
15
15