[CDRIVER-1173] Remove malloc for Decimal128 conversion during BSON->JSON Created: 24/Mar/16 Updated: 10/Aug/16 Resolved: 15/Jun/16 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 1.4.0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Hannes Magnusson | Assignee: | Fiona Rowan |
| Resolution: | Done | Votes: | 0 |
| Labels: | intern2016 | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Description |
|
Since bson_decimal128_from_string () requires a null terminated string, the BSON to JSON conversion for bson_decimal128_t allocates a new string+1 since the input isn't null terminated. We should be able to avoid that extra malloc, either though stack allocation or passing the length to the bson_decimal128_from_string () function. |
| Comments |
| Comment by Githook User [ 15/Jun/16 ] |
|
Author: {u'username': u'fionaRowan', u'name': u'Fiona Rowan', u'email': u'fmr2112@columbia.edu'}Message: |
| Comment by Fiona Rowan [ 06/Jun/16 ] |
|
this is in _bson_json_read_string () in bson-json.c |
| Comment by A. Jesse Jiryu Davis [ 06/Jun/16 ] |
|
Small optimization in libbson. |