Commit Graph

114 Commits

Author SHA1 Message Date
Hongli Lai (Phusion) 2335108162 When possible, use system_free() to free asprintf() results.
On OS X, Ruby Enterprise Edition allocates memory with tcmalloc which is
not compatible with the system malloc. asprintf() allocates memory with
the system malloc so we need to free its result with the system free()
function instead of tcmalloc's free() function. REE's system_free()
API call does that.
2011-02-14 09:41:39 -05:00
Kyle Banker 76730d4a7c RUBY-233 show invalid key on invalid key exception 2011-02-04 12:07:28 -05:00
Kyle Banker 9798626053 RUBY-188 fix for bson_ext on Windows 2011-01-04 18:09:41 -05:00
Kyle Banker bc5dcdfc7f Fix for undefined symbol rb_long2int 2011-01-03 16:15:58 -05:00
eregon a0389b0668 define R{ARRAY,STRING}_LENINT if there are not 2011-01-03 14:21:12 -05:00
eregon 3ab2acbf4f Get rid of "implicit conversion 64-bit 32-bit" warnings
This resolves "warning: implicit conversion shortens 64-bit value into a 32-bit value"
The problem is String/Array length is a long (so 64 bits on some platforms instead of 32) and the extension use int
There are 2 solutions:
* use long everywhere (but waste of memory, and hard to do)
* cast into ints (but potential lost of data)
I did the second, because all these cases are about String/Array lengths,
and it is very unlikely to have a String/Array of more than 2 billions elements (that would mean at least 2GB in memory).

The last cast might need to be reviewed (htonl((int)time(NULL))) because htonl want a 32-bit int, but time(NULL) will overflow with the year 2038 problem.
2011-01-03 14:20:58 -05:00
Kyle Banker c0e972470e Fixed BSON_CODER.update_max_bson_size return value 2011-01-03 14:05:42 -05:00
Kyle Banker 9da68bb3db RUBY-189 use result of ismaster's maxBsonObjectSize 2010-12-29 18:06:31 -05:00
eregon 191db33a1a fix declaration-after-statement warnings of ruby trunk
The commit bd0a9d2fb6
adds -Werror=declaration-after-statement. This may cause an error and make gem installation fail
See http://www.ruby-forum.com/topic/714046
2010-12-29 12:06:38 -05:00
Kyle Banker 6f067756c8 Fix for serializing int/long 2010-11-08 17:21:17 -05:00
Kyle Banker b3ed1486e5 minor: updates for removal deprecated DB and Connection methods and ObjectID 2010-10-04 13:28:26 -04:00
Kyle Banker 2ed0adbbc6 Fix C extension to handle BSON::Code (no longer a subclass of String) 2010-10-01 17:03:26 -04:00
Kyle Banker 45e6aaef43 minor: fast_pack no longer used 2010-09-20 14:01:17 -04:00
Kyle Banker b077ef992d RUBY-182 Rubinius compatibility; use rb_ary_entry() in lieu of RARRAY_PTR 2010-09-20 13:48:06 -04:00
Kyle Banker 81395373e9 RUBY-183 better int bson performance (Chuck Remes) 2010-09-20 11:57:06 -04:00
Hongli Lai (Phusion) bfa4926e1d Optimize ObjectId#generate: cache the MD5 of the host name and generate counters in C instead of Ruby. 2010-09-14 10:37:22 -04:00
Hongli Lai (Phusion) 3f66721858 Optimize BSON C extension: cache some symbols instead of interning them over and over. 2010-09-13 10:51:29 -04:00
Kyle Banker 7ca4683843 RUBY-173 better hash class detection for BSON 2010-08-28 16:35:45 -04:00
Kyle Banker 5838b9aef7 RUBY-173 allow HashWithIndifferentAccess 2010-08-28 12:19:26 -04:00
Mike Dirolf 06602bd41e clean up C ext Time handling 2010-08-25 11:27:38 -04:00
Mike Dirolf 7702d671ea Use C objectid_generate for ObjectId in addition to ObjectID.
Also, remove broken defined? check from objectid.rb and object_id.rb -
it was never doing anything since we require those files at the top of
cbson.c.
2010-08-25 10:23:18 -04:00
Kyle Banker 02a0c7c2dc RUBY-165 raise error if BSON.serialize is passed something other than a hash 2010-08-24 14:01:24 -04:00
Kyle Banker c7c309b00d RUBY-158 deprecate BSON::ObjectID for BSON::ObjectId 2010-08-24 12:49:23 -04:00
Kyle Banker a24448d911 attempted fix for bson_ext on solaris (slyphon) 2010-07-02 16:03:42 -04:00
Mike Dirolf d68e42812e respect Encoding.default_internal in BSON decoder 2010-05-07 15:15:52 -04:00
sleverbor ed76126a12 namespaced the OrderedHash class 2010-05-06 18:25:18 -07:00
Kyle Banker 8ac3171981 ensure compatibility with early releases of Ruby 1.8.5 (dfitzgibbon) RUBY-125 2010-04-28 10:43:54 -04:00
Kyle Banker 910a82de7e must use Connection.paired for paired connections 2010-04-07 17:10:28 -04:00
Kyle Banker e18d2d6fbb removed deprecated RegexpOfHolding 2010-04-07 16:32:25 -04:00
Kyle Banker 45d3b91882 exception refinements for bson split 2010-04-05 18:24:31 -04:00
Kyle Banker c4d5cb641b renamed mongo_bson to bson 2010-04-05 10:39:55 -04:00
Charles Remes b669b625cc Changed RREGEXP_SOURCE macro to RREGX_SRC so it matches all rubies 2010-03-19 09:10:08 -05:00
Charles Remes a9b3c8e7a5 Try again: Split the BSON logic out to a separate gem
- changed the BSON constant to BSON_CODER and scoped it inside
      of a module

    - changed the directory layout for all of the BSON related files

    - updated the C extension to find the BSON files at their new
      directory locations

    - updated the C extension to use better/safer macros for accessing
      the C API; extension now compiles cleanly under rubinius/rbx

    - changed directory layout for BSON related tests

    - modified the Rakefile to understand the new layout
2010-03-17 14:55:19 -05:00
Kyle Banker 0709b98082 Rails 3 HashWithIndifferentAccess fixes 2010-03-02 11:11:07 -05:00
Kyle Banker e3d746096d minor: docs 2010-03-01 12:09:21 -05:00
Kyle Banker 2d9e10c192 CBson HashWithIndifferentAccess error 2010-02-27 12:22:34 -05:00
Kyle Banker fc2ddf3bbd deserialize to RegexpOfHolding only when necessary 2010-02-15 09:47:53 -05:00
Kyle Banker e075d25a91 move id only when necessary RUBY-88 2010-01-28 18:44:50 -05:00
Kyle Banker 28227f8ac6 minor: fix for 1.8.6 Complex type checking 2010-01-21 15:42:59 -05:00
Kyle Banker 95d9d6b4f6 Handle unsupported types: Complex, Rational, and BigDecimal RUBY-85 2010-01-21 14:49:20 -05:00
Kyle Banker bf7ffcfa82 support BSON MinKey and MaxKey RUBY-84 2010-01-20 18:50:07 -05:00
Kyle Banker 8c6e0a3591 Raise better error message when trying to serialize TimeWithZone 2010-01-20 12:11:58 -05:00
Mike Dirolf f2de52351a minor: fix some warnings 2010-01-11 18:01:36 -05:00
Kyle Banker 3762e52ac2 minor: fixed exception organization 2010-01-11 11:38:35 -05:00
Kyle Banker 42b835243e warn if using Date or DateTime instead of Time 2010-01-06 14:30:58 -05:00
Mike Dirolf e013618a8f RUBY-74 raise InvalidDocument for any unrecognized types 2009-12-29 12:59:30 -05:00
Mike Dirolf f8d45c405e check for asprintf instead of _MSC_VER - better for mingw 2009-12-18 14:19:53 -05:00
Mike Dirolf 65c36ca943 null checking for keys and regex patterns, allow nulls for regular strings 2009-12-17 12:17:19 -05:00
Mike Dirolf f9fb823c53 Merge branch 'master' of github.com:mongodb/mongo-ruby-driver 2009-12-17 09:47:29 -05:00
Mike Dirolf d5f0443fc1 better error message 2009-12-17 09:47:27 -05:00