mirror of
https://github.com/json-c/json-c.git
synced 2026-03-29 09:59:06 +08:00
json_object_private: remove _delete field
This field is set based on o_type when the object is created and it is not changed during the lifetime of the object. Therefore we can check o_type to choose the proper delete function in json_object_put(), and save sizeof(void *) bytes in struct json_object_private.
This commit is contained in:
@@ -22,13 +22,10 @@ extern "C" {
|
||||
|
||||
#define LEN_DIRECT_STRING_DATA 32 /**< how many bytes are directly stored in json_object for strings? */
|
||||
|
||||
typedef void (json_object_private_delete_fn)(struct json_object *o);
|
||||
|
||||
struct json_object
|
||||
{
|
||||
enum json_type o_type;
|
||||
uint32_t _ref_count;
|
||||
json_object_private_delete_fn *_delete;
|
||||
json_object_to_json_string_fn *_to_json_string;
|
||||
struct printbuf *_pb;
|
||||
union data {
|
||||
|
||||
Reference in New Issue
Block a user