Projects
Eulaceura:Factory
dim
_service:obs_scm:backport-Add-memory-debug-in-m...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:obs_scm:backport-Add-memory-debug-in-mem_pool.patch of Package dim
From 2ca49371b548b56d192f571866fb28c548746ad1 Mon Sep 17 00:00:00 2001 From: Huaxin Lu <luhuaxin1@huawei.com> Date: Mon, 19 Feb 2024 10:35:34 +0800 Subject: [PATCH 20/26] Add memory debug in mem_pool --- src/core/dim_core_mem_pool.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/core/dim_core_mem_pool.c b/src/core/dim_core_mem_pool.c index 974033f..a9f0177 100644 --- a/src/core/dim_core_mem_pool.c +++ b/src/core/dim_core_mem_pool.c @@ -4,6 +4,7 @@ #include <linux/mm.h> +#include "dim_safe_func.h" #include "dim_utils.h" #include "dim_core_mem_pool.h" @@ -108,6 +109,9 @@ void *dim_mem_pool_alloc(size_t size) if (data == NULL) return NULL; out: + #ifdef DIM_DEBUG_MEMORY_LEAK + dim_alloc_debug_inc(); + #endif data->size = mem_size; return data->data; } @@ -130,6 +134,10 @@ void dim_mem_pool_free(const void *data) } gen_pool_free(dim_pool, (uintptr_t)mem, mem->size); + + #ifdef DIM_DEBUG_MEMORY_LEAK + dim_alloc_debug_dec(); + #endif } void dim_mem_pool_walk_chunk(pool_chunk_visitor f, void *data) -- 2.33.0
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2