mirror of
https://github.com/msgpack/msgpack-python.git
synced 2025-10-19 20:03:16 +00:00
Reduce memory footprint.
This commit is contained in:
parent
d32b48f98f
commit
de6afa5285
2 changed files with 7 additions and 6 deletions
|
@ -23,9 +23,7 @@
|
|||
#define MSGPACK_MAX_STACK_SIZE (1024)
|
||||
#include "unpack_define.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
typedef map<string, PyObject*> str_cach_t;
|
||||
typedef std::map<std::string, PyObject*> str_cach_t;
|
||||
struct unpack_user {
|
||||
str_cach_t strcache;
|
||||
|
||||
|
@ -127,7 +125,7 @@ static inline int template_callback_map_item(unpack_user* u, msgpack_unpack_obje
|
|||
static inline int template_callback_raw(unpack_user* u, const char* b, const char* p, unsigned int l, msgpack_unpack_object* o)
|
||||
{
|
||||
if (l < 16) {
|
||||
string s(p, l);
|
||||
std::string s(p, l);
|
||||
str_cach_t ::iterator it = u->strcache.find(s);
|
||||
if (it != u->strcache.end()) {
|
||||
*o = it->second;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue