diff options
author | Joshua Haberman <jhaberman@gmail.com> | 2016-04-27 10:37:33 -0700 |
---|---|---|
committer | Joshua Haberman <jhaberman@gmail.com> | 2016-04-27 10:37:33 -0700 |
commit | f53f911793c3024976f80211e0c976f5cc51f88d (patch) | |
tree | 5ba3d99075964857b47b3b0402b24fbccf2f51e7 /ruby/ext/google/protobuf_c/encode_decode.c | |
parent | 66f074592dc343d6b4f7ad62fda5c26cccf6bf45 (diff) | |
parent | d419ca10b4521e87d0be62f6df4ede97d63c7ee2 (diff) | |
download | protobuf-f53f911793c3024976f80211e0c976f5cc51f88d.tar.gz protobuf-f53f911793c3024976f80211e0c976f5cc51f88d.tar.bz2 protobuf-f53f911793c3024976f80211e0c976f5cc51f88d.zip |
Merge pull request #1455 from haberman/updateupb
Updated upb and simplified ruby code a bit with new upb method.
Diffstat (limited to 'ruby/ext/google/protobuf_c/encode_decode.c')
-rw-r--r-- | ruby/ext/google/protobuf_c/encode_decode.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/ruby/ext/google/protobuf_c/encode_decode.c b/ruby/ext/google/protobuf_c/encode_decode.c index 9bc7273e..f6bea50f 100644 --- a/ruby/ext/google/protobuf_c/encode_decode.c +++ b/ruby/ext/google/protobuf_c/encode_decode.c @@ -656,7 +656,6 @@ static const upb_json_parsermethod *msgdef_jsonparsermethod(Descriptor* desc) { #define STACK_ENV_STACKBYTES 4096 typedef struct { upb_env env; - upb_seededalloc alloc; const char* ruby_error_template; char allocbuf[STACK_ENV_STACKBYTES]; } stackenv; @@ -681,16 +680,12 @@ static bool env_error_func(void* ud, const upb_status* status) { static void stackenv_init(stackenv* se, const char* errmsg) { se->ruby_error_template = errmsg; - upb_env_init(&se->env); - upb_seededalloc_init(&se->alloc, &se->allocbuf, STACK_ENV_STACKBYTES); - upb_env_setallocfunc( - &se->env, upb_seededalloc_getallocfunc(&se->alloc), &se->alloc); + upb_env_init2(&se->env, se->allocbuf, sizeof(se->allocbuf), NULL); upb_env_seterrorfunc(&se->env, env_error_func, se); } static void stackenv_uninit(stackenv* se) { upb_env_uninit(&se->env); - upb_seededalloc_uninit(&se->alloc); } /* |