diff --git a/list/list_expand.c b/list/list_expand.c index 84b8157..e0cf001 100644 --- a/list/list_expand.c +++ b/list/list_expand.c @@ -355,7 +355,7 @@ unsigned long long calListMemory(List * p_list){ unsigned long long nodes_size = 0LL; unsigned long long list_size = sizeof(p_list); while(p_node != NULL){ - nodes_size += sizeof(p_node) + sizeof(*p_node->value); + nodes_size += sizeof(p_node); p_node = p_node->next; } return list_size + nodes_size; diff --git a/tree/tree_expand.c b/tree/tree_expand.c index 48e891a..e188663 100644 --- a/tree/tree_expand.c +++ b/tree/tree_expand.c @@ -222,6 +222,6 @@ unsigned long long calTreeMemory(Tree *p_tree){ } int _doCalTreeMemory(TNode *p_tnode, unsigned long long height){ - tnodes_size += sizeof(p_tnode) + sizeof(*p_tnode->value); + tnodes_size += sizeof(p_tnode); return 0; }