Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
memory_leaks Namespace Reference

Functions

 find_call_and_line (elem, file, directory)
 

Variables

str directory = "../src/iop/"
 
str alloc_regex = r"([a-zA-Z0-9_\->\.\[\]]+) = (dt_|c|m|dt_opencl_)alloc.*\‍(.+\‍)"
 
 f = open(os.path.join(directory, file), "r")
 
 content = f.read()
 
 matches = re.finditer(alloc_regex, content, re.MULTILINE)
 
int safe_allocs = 0
 
int faulty_allocs = 0
 
int suspicious_allocs = 0
 
 variable_name = match.group(1)
 
 alloc_type = match.group(2)
 
str variable_alloc_regex = " %s = %salloc.*\‍(.+\‍)" % (variable_name, alloc_type)
 
 matches2 = re.findall(variable_alloc_regex, content, re.MULTILINE)
 
 allocs = len(matches2)
 
str variable_free_regex = r""
 
str buffer_type = ""
 
 matches3 = re.findall(variable_free_regex, content, re.MULTILINE)
 
 frees = len(matches3)
 
str msg_type = "INFO"
 

Function Documentation

◆ find_call_and_line()

memory_leaks.find_call_and_line (   elem,
  file,
  directory 
)

Variable Documentation

◆ alloc_regex

str memory_leaks.alloc_regex = r"([a-zA-Z0-9_\->\.\[\]]+) = (dt_|c|m|dt_opencl_)alloc.*\‍(.+\‍)"

◆ alloc_type

memory_leaks.alloc_type = match.group(2)

◆ allocs

memory_leaks.allocs = len(matches2)

◆ buffer_type

str memory_leaks.buffer_type = ""

◆ content

memory_leaks.content = f.read()

◆ directory

str memory_leaks.directory = "../src/iop/"

◆ f

memory_leaks.f = open(os.path.join(directory, file), "r")

◆ faulty_allocs

int memory_leaks.faulty_allocs = 0

◆ frees

memory_leaks.frees = len(matches3)

◆ matches

memory_leaks.matches = re.finditer(alloc_regex, content, re.MULTILINE)

◆ matches2

memory_leaks.matches2 = re.findall(variable_alloc_regex, content, re.MULTILINE)

◆ matches3

memory_leaks.matches3 = re.findall(variable_free_regex, content, re.MULTILINE)

◆ msg_type

str memory_leaks.msg_type = "INFO"

◆ safe_allocs

int memory_leaks.safe_allocs = 0

◆ suspicious_allocs

int memory_leaks.suspicious_allocs = 0

◆ variable_alloc_regex

str memory_leaks.variable_alloc_regex = " %s = %salloc.*\‍(.+\‍)" % (variable_name, alloc_type)

◆ variable_free_regex

str memory_leaks.variable_free_regex = r""

◆ variable_name

memory_leaks.variable_name = match.group(1)