• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

nasa / trick / 25459968639

06 May 2026 08:42PM UTC coverage: 55.916% (-0.8%) from 56.7%
25459968639

Pull #2011

github

web-flow
Merge f11412d5f into 7054e405e
Pull Request #2011: Single-file CI and code style adoption

14607 of 26123 relevant lines covered (55.92%)

466416.66 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

38.71
/trick_source/sim_services/MemoryManager/MemoryManager_alloc_info_map.cpp
1
#include "trick/MemoryManager.hh"
2
#include <sstream>
3
#include <string.h>
4

5
ALLOC_INFO* Trick::MemoryManager::get_alloc_info_of( void* addr) {
4,891✔
6

7
    ALLOC_INFO_MAP::iterator pos = alloc_info_map.lower_bound(addr);
4,891✔
8
    if (pos != alloc_info_map.end()) {
4,891✔
9
        ALLOC_INFO* alloc_info = pos->second;
4,694✔
10
        if (( addr >= alloc_info->start) && ( addr <= alloc_info->end)) {
4,694✔
11
            return(alloc_info);
4,693✔
12
        }
13
    }
14
    return NULL;
198✔
15
}
16

17
ALLOC_INFO* Trick::MemoryManager::get_alloc_info_at( void* addr) {
13,415✔
18

19
    ALLOC_INFO_MAP::iterator pos = alloc_info_map.find( addr);
13,415✔
20
    if (pos == alloc_info_map.end()) {
13,415✔
21
        return NULL;
400✔
22
    } else {
23
        return( pos->second);
13,015✔
24
    }
25
}
26

27
int Trick::MemoryManager::set_name_at( void* addr , const char * name ) {
×
28

29
    int ret = 0 ;
×
30

31
    ALLOC_INFO_MAP::iterator pos = alloc_info_map.find( addr);
×
32
    if (pos != alloc_info_map.end()) {
×
33
        pos->second->name = strdup(name) ;
×
34
        pthread_mutex_lock(&mm_mutex);
×
35
        VARIABLE_MAP::iterator variable_pos;
×
36
        variable_pos = variable_map.find(name);
×
37
        if (variable_pos != variable_map.end()) {
×
38
            std::stringstream ss;
×
39
            ss << "Call to set_name_at() failed because a variable named \""
40
               << name << "\" already exists.";
×
41
            emitError(ss.str());
×
42
            pthread_mutex_unlock(&mm_mutex);
×
43
            ret = -1 ;
×
44
        } else {
×
45
            variable_map[name] = pos->second ;
×
46
        }
47
        pthread_mutex_unlock(&mm_mutex);
×
48
    } else {
49
        ret = -1 ;
×
50
    }
51
    return ret ;
×
52
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc