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

nasa / trick / 21039148268

15 Jan 2026 04:46PM UTC coverage: 55.67% (-0.2%) from 55.875%
21039148268

Pull #1965

github

web-flow
Merge b6d3aa7f1 into 36fe2139e
Pull Request #1965: 1964 methods return size one pointers

91 of 128 new or added lines in 3 files covered. (71.09%)

1022 existing lines in 21 files now uncovered.

12573 of 22585 relevant lines covered (55.67%)

299072.13 hits per line

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

25.86
/trick_source/sim_services/MemoryManager/MemoryManager_C_Intf.cpp
1
#include <string>
2
#include <iostream>
3
#include "trick/memorymanager_c_intf.h"
4
#include "trick/MemoryManager.hh"
5

6
/* Global singleton pointer to the memory manager. */
7
extern Trick::MemoryManager* trick_MM;
8

9
/**
10
 @relates Trick::MemoryManager
11
 This is the C Language version of the 6 argument version of Trick::MemoryManager::declare_var.
12
 The arguments and return value are the same except that std::string args are replaced with const char * args.
13
 */
14
extern "C" void* TMM_declare_var( TRICK_TYPE type, const char*class_name, int n_stars, const char* var_name, int n_cdims, int *cdims) {
19✔
15
    if (trick_MM != NULL) {
19✔
16
        std::string sclass_name = class_name;
38✔
17
        std::string svar_name = var_name;
19✔
18
        return ( trick_MM->declare_var( type, sclass_name, n_stars, svar_name, n_cdims, cdims));
19✔
19
    } else {
20
        Trick::MemoryManager::emitError("TMM_declare_var() called before MemoryManager instantiation. Returning NULL.") ;
×
21
        return ( (void*)NULL);
×
22
    }
23
}
24

25
/**
26
 @relates Trick::MemoryManager
27
 This is the C Language version of the 2 argument version of Trick::MemoryManager::declare_var.
28
 The arguments and return value are the same.
29
 */
30
extern "C" void* TMM_declare_var_1d( const char* enh_type_spec, int e_elems) {
601✔
31
    if (trick_MM != NULL) {
601✔
32
        return ( trick_MM->declare_var( enh_type_spec, e_elems));
601✔
33
    } else {
34
        Trick::MemoryManager::emitError("TMM_declare_var_1d() called before MemoryManager instantiation. Returning NULL.\n") ;
×
35
        return ( (void*)NULL);
×
36
    }
37
}
38

39
/**
40
 @relates Trick::MemoryManager
41
 This is the C Language version of the 1 argument version of Trick::MemoryManager::declare_var.
42
 The arguments and return value are the same.
43
 */
44
extern "C" void* TMM_declare_var_s( const char* declaration) {
3,028✔
45
    if (trick_MM != NULL) {
3,028✔
46
        return ( trick_MM->declare_var( declaration));
3,028✔
47
    } else {
48
        Trick::MemoryManager::emitError("TMM_declare_var_s() called before MemoryManager instantiation. Returning NULL.\n") ;
×
49
        return ( (void*)NULL);
×
50
    }
51
}
52

53
/**
54
 @relates Trick::MemoryManager
55
 This is a C Language interface to the 2 argument version of Trick::MemoryManager::declare_var.
56
 The arguments are the same but switched in order and the return value is the same.
57
 It's here because I caved to Alex's whine about backwards compatibility.
58

59
 */
60
extern "C" void* alloc_type( int e_elems, const char* enh_type_spec) {
94✔
61
    if (trick_MM != NULL) {
94✔
62
        return ( trick_MM->declare_var( enh_type_spec, e_elems));
94✔
63
    } else {
64
        Trick::MemoryManager::emitError("alloc_type() called before MemoryManager instantiation. Returning NULL.\n") ;
×
65
        return ( (void*)NULL);
×
66
    }
67
}
68

69
/**
70
 @relates Trick::MemoryManager
71
 This is the C Language version of the 6 argument version of Trick::MemoryManager::declare_var.
72
 The arguments and return value are the same except that std::string args are replaced with const char * args.
73
 */
74
extern "C" void* TMM_declare_operatornew_var( const char * class_name, unsigned int alloc_size , unsigned int element_size ) {
×
75
    if (trick_MM != NULL) {
×
76
        return trick_MM->declare_operatornew_var( std::string(class_name), alloc_size, element_size ) ;
×
77
    } else {
78
        Trick::MemoryManager::emitError("TMM_declare_var() called before MemoryManager instantiation. Returning NULL.\n") ;
×
79
        return (void*)NULL ;
×
80
    }
81
}
82

UNCOV
83
extern "C" void* TMM_declare_operatornew_var_with_name( const char * class_name, unsigned int alloc_size , unsigned int element_size, const char * alloc_name ) {
×
UNCOV
84
    if (trick_MM != NULL) {
×
UNCOV
85
        return trick_MM->declare_operatornew_var( std::string(class_name), alloc_size, element_size, std::string(alloc_name) ) ;
×
86
    } else {
UNCOV
87
        Trick::MemoryManager::emitError("TMM_declare_var() called before MemoryManager instantiation. Returning NULL.\n") ;
×
UNCOV
88
        return (void*)NULL ;
×
89
    }
90
}
91

92
/**
93
 @relates Trick::MemoryManager
94
 This is the C Language version of the 7 argument version of Trick::MemoryManager::declare_ext_var.
95
 The arguments and return value are the same except that std::string args are replaced with const char * args.
96
 */
97
extern "C" void* TMM_declare_ext_var( void* addr, TRICK_TYPE type, const char*class_name, int n_stars, const char* var_name, int n_cdims, int *cdims) {
4,798✔
98
    if (trick_MM != NULL) {
4,798✔
99
        std::string sclass_name = class_name;
9,596✔
100
        std::string svar_name = var_name;
4,798✔
101
        return ( trick_MM->declare_extern_var( addr, type, sclass_name, n_stars, svar_name, n_cdims, cdims));
4,798✔
102
    } else {
UNCOV
103
        Trick::MemoryManager::emitError("TMM_declare_ext_var() called before MemoryManager instantiation. Returning NULL.\n") ;
×
104
        return ( (void*)NULL);
×
105
    }
106
}
107

108
/**
109
 @relates Trick::MemoryManager
110
 This is the C Language version of the 4 argument version of Trick::MemoryManager::declare_var.
111
 The arguments and return value are the same.
112
 */
UNCOV
113
extern "C" void* TMM_declare_ext_var_1d( void* addr, const char* elem_decl, int n_elems) {
×
UNCOV
114
    if (trick_MM != NULL) {
×
UNCOV
115
        return ( trick_MM->declare_extern_var( addr, elem_decl, n_elems));
×
116
    } else {
UNCOV
117
        Trick::MemoryManager::emitError("TMM_declare_ext_var_1d() called before MemoryManager instantiation. Returning NULL.\n") ;
×
118
        return ( (void*)NULL);
×
119
    }
120
}
121

122
/**
123
 @relates Trick::MemoryManager
124
 This is the C Language version of the 1 argument version of Trick::MemoryManager::declare_extern_var.
125
 The arguments and return value are the same.
126
 */
UNCOV
127
extern "C" void* TMM_declare_ext_var_s( void* addr, const char* declaration) {
×
UNCOV
128
    if (trick_MM != NULL) {
×
UNCOV
129
        return ( trick_MM->declare_extern_var(addr, declaration));
×
130
    } else {
UNCOV
131
        Trick::MemoryManager::emitError("TMM_declare_ext_var_s() called before MemoryManager instantiation. Returning NULL.\n") ;
×
UNCOV
132
        return ( (void*)NULL);
×
133
    }
134
}
135

136
/**
137
 @relates Trick::MemoryManager
138
 This is the C Language, "identify the array by address", version of Trick::MemoryManager::resize_array.
139
 Resize each of the dimensions of the array at the given address. n_cdims specifies the number
140
 of dimensions and must match those of the array being resized. cdims specifies the new sizes
141
 for each of the dimensions.
142
 */
UNCOV
143
void* TMM_resize_array_a(void *address, int n_cdims, int *cdims){
×
UNCOV
144
    if (trick_MM != NULL) {
×
UNCOV
145
        return ( trick_MM->resize_array(address, n_cdims, cdims));
×
146
    } else {
UNCOV
147
        Trick::MemoryManager::emitError("TMM_resize_array_a() called before MemoryManager instantiation. Returning NULL.\n") ;
×
UNCOV
148
        return ( (void*)NULL);
×
149
    }
150
}
151

152
/**
153
 @relates Trick::MemoryManager
154
 This is the C Language, "identify the array by name", version of Trick::MemoryManager::resize_array.
155
 Resize each of the dimensions of the array whose name is given. n_cdims specifies the number
156
 of dimensions and must match those of the array being resized. cdims specifies the new sizes
157
 for each of the dimensions.
158
 */
UNCOV
159
void* TMM_resize_array_n(const char *name, int n_cdims, int *cdims){
×
UNCOV
160
    if (trick_MM != NULL) {
×
UNCOV
161
        return ( trick_MM->resize_array(name, n_cdims, cdims));
×
162
    } else {
UNCOV
163
        Trick::MemoryManager::emitError("TMM_resize_array_n() called before MemoryManager instantiation. Returning NULL.\n") ;
×
UNCOV
164
        return ( (void*)NULL);
×
165
    }
166
}
167

168
/**
169
 @relates Trick::MemoryManager
170
 This is the C Language version of Trick::MemoryManager::resize_array(address, num).
171
 Resize the one dimensional array at the given address.
172
 */
173
void* TMM_resize_array_1d_a(void* address, int num){
36✔
174
    if (trick_MM != NULL) {
36✔
175
        return ( trick_MM->resize_array(address, num));
36✔
176
    } else {
UNCOV
177
        Trick::MemoryManager::emitError("TMM_resize_array_1d_a() called before MemoryManager instantiation. Returning NULL.\n") ;
×
178
        return ( (void*)NULL);
×
179
    }
180
}
181

182
/**
183
 @relates Trick::MemoryManager
184
 This is the C Language version of Trick::MemoryManager::resize_array(name, num).
185
 Resize the one dimensional array whose name is given.
186
 */
UNCOV
187
void* TMM_resize_array_1d_n(const char *name, int num){
×
UNCOV
188
    if (trick_MM != NULL) {
×
UNCOV
189
        return ( trick_MM->resize_array(name, num));
×
190
    } else {
UNCOV
191
        Trick::MemoryManager::emitError("TMM_resize_array_1d_n() called before MemoryManager instantiation. Returning NULL.\n") ;
×
UNCOV
192
        return ( (void*)NULL);
×
193
    }
194
}
195

196
/**
197
 @relates Trick::MemoryManager
198
 This is the C Language version of Trick::MemoryManager::mm_strdup( str).
199
 Duplicate and catalog the given character string.
200
 */
201
extern "C" char* TMM_strdup(char *str) {
345✔
202
    if (trick_MM != NULL) {
345✔
203
        return ( trick_MM->mm_strdup( str));
345✔
204
    } else {
UNCOV
205
        Trick::MemoryManager::emitError("TMM_strdup called before MemoryManager instantiation. Returning NULL.\n") ;
×
UNCOV
206
        return( (char*)NULL);
×
207
    }
208
}
209

210
/**
211
 @relates Trick::MemoryManager
212
 This is the C Language version of Trick::MemoryManager::var_exists().
213
 Test whether the given variable_name is in use.
214
 */
215
extern "C" int TMM_var_exists( const char* var_name) {
42✔
216
    if (trick_MM != NULL) {
42✔
217
        std::string svar_name = var_name;
42✔
218
        return ( trick_MM->var_exists( svar_name));
42✔
219
    } else {
UNCOV
220
        Trick::MemoryManager::emitError("TMM_var_exists() called before MemoryManager instantiation.\n") ;
×
UNCOV
221
        return (0);
×
222
    }
223
}
224

225
/**
226
 @relates Trick::MemoryManager
227
 This is the C Language version of Trick::MemoryManager::var_exists().
228
 Test whether the given address is in Trick managed memory.  C interface to Trick::MemoryManager::is_alloced( addr).
229
 */
230
extern "C" int TMM_is_alloced(char *addr) {
388✔
231
    if (trick_MM != NULL) {
388✔
232
        return ( trick_MM->is_alloced( addr));
388✔
233
    } else {
UNCOV
234
        Trick::MemoryManager::emitError("TMM_is_alloced() called before MemoryManager instantiation.\n") ;
×
235
        return (0);
×
236
    }
237
}
238

239
/**
240
 @relates Trick::MemoryManager
241
 This is the C Language version of Trick::MemoryManager::set_debug_level(level).
242
 Set the verbosity of MemoryManager debug messages.  C interface to Trick::MemoryManager::set_debug_level( level).
243
 */
UNCOV
244
extern "C" void TMM_set_debug_level(int level) {
×
UNCOV
245
    if (trick_MM != NULL) {
×
UNCOV
246
        trick_MM->set_debug_level( level);
×
247
    } else {
248
        Trick::MemoryManager::emitError("TMM_set_debug_level() called before MemoryManager instantiation.\n") ;
×
249
    }
UNCOV
250
}
×
251

252
/**
253
 This is the C Language version of Trick::MemoryManager::set_reduced_checkpoint( yesno).
254
 @relates Trick::MemoryManager
255
 */
UNCOV
256
extern "C" void TMM_reduced_checkpoint(int yesno) {
×
UNCOV
257
    if (trick_MM != NULL) {
×
UNCOV
258
        trick_MM->set_reduced_checkpoint( yesno!=0 );
×
259
    } else {
260
        Trick::MemoryManager::emitError("TMM_reduced_checkpoint() called before MemoryManager instantiation.\n") ;
×
261
    }
UNCOV
262
}
×
263

264
/**
265
 @relates Trick::MemoryManager
266
 This is the C Language version of Trick::MemoryManager::set_hexfloat_checkpoint( yesno).
267
 */
UNCOV
268
extern "C" void TMM_hexfloat_checkpoint(int yesno) {
×
UNCOV
269
    if (trick_MM != NULL) {
×
UNCOV
270
        trick_MM->set_hexfloat_checkpoint( yesno!=0 );
×
271
    } else {
UNCOV
272
        Trick::MemoryManager::emitError("TMM_hexfloat_checkpoint() called before MemoryManager instantiation.\n") ;
×
273
    }
274
}
×
275

276
/**
277
 @relates Trick::MemoryManager
278
 This is the C Language version of Trick::MemoryManager::set_hexfloat_decimal_comment_checkpoint( yesno).
279
 */
UNCOV
280
extern "C" void TMM_hexfloat_decimal_comment_checkpoint(int yesno) {
×
UNCOV
281
    if (trick_MM != NULL) {
×
UNCOV
282
        trick_MM->set_hexfloat_decimal_comment_checkpoint( yesno!=0 );
×
283
    } else {
UNCOV
284
        Trick::MemoryManager::emitError("TMM_hexfloat_decimal_comment_checkpoint() called before MemoryManager instantiation.\n") ;
×
285
    }
UNCOV
286
}
×
287

288
/**
289
 @relates Trick::MemoryManager
290
 This is the C Language version of Trick::MemoryManager::clear_var( addr).
291
 */
292
extern "C" void TMM_clear_var_a(void *addr) {
×
UNCOV
293
    if (trick_MM != NULL) {
×
UNCOV
294
        trick_MM->clear_var( addr);
×
295
    } else {
UNCOV
296
        Trick::MemoryManager::emitError("TMM_clear_var_a() called before MemoryManager instantiation.\n") ;
×
UNCOV
297
        return;
×
298
    }
299
}
300

301
/**
302
 @relates Trick::MemoryManager
303
 This is the C Language version of Trick::MemoryManager::clear_var( name).
304
 */
305
extern "C" void TMM_clear_var_n( const char* name) {
×
UNCOV
306
    if (trick_MM != NULL) {
×
UNCOV
307
        trick_MM->clear_var( name);
×
308
    } else {
UNCOV
309
        Trick::MemoryManager::emitError("TMM_clear_var_n() called before MemoryManager instantiation.\n") ;
×
UNCOV
310
        return;
×
311
    }
312
}
313

314
/**
315
 @relates Trick::MemoryManager
316
 This is the C Language version of Trick::MemoryManager::delete_var( addr).
317
 */
318
extern "C" void TMM_delete_var_a(void *addr) {
372✔
319
    if (trick_MM != NULL) {
372✔
320
        trick_MM->delete_var( addr);
372✔
321
    } else {
UNCOV
322
        Trick::MemoryManager::emitError("TMM_delete_var_a() called before MemoryManager instantiation.\n") ;
×
UNCOV
323
        return;
×
324
    }
325
}
326

327
/**
328
 @relates Trick::MemoryManager
329
 This is the C Language version of Trick::MemoryManager::delete_var( name).
330
 */
331
extern "C" void TMM_delete_var_n( const char* name) {
1,931✔
332
    if (trick_MM != NULL) {
1,931✔
333
        trick_MM->delete_var( name);
1,931✔
334
    } else {
UNCOV
335
        Trick::MemoryManager::emitError("TMM_delete_var_n() called before MemoryManager instantiation.\n") ;
×
UNCOV
336
        return;
×
337
    }
338
}
339

340
/**
341
 @relates Trick::MemoryManager
342
 This is the C Language version of Trick::MemoryManager::delete_extern_var( addr).
343
 */
344
extern "C" void TMM_delete_extern_var_a(void *addr) {
×
UNCOV
345
    if (trick_MM != NULL) {
×
UNCOV
346
        trick_MM->delete_extern_var( addr);
×
347
    } else {
UNCOV
348
        Trick::MemoryManager::emitError("TMM_delete_extern_var_a() called before MemoryManager instantiation.\n") ;
×
UNCOV
349
        return;
×
350
    }
351
}
352

353
/**
354
 @relates Trick::MemoryManager
355
 This is the C Language version of Trick::MemoryManager::delete_extern_var( name).
356
 */
357
extern "C" void TMM_delete_extern_var_n( const char* name) {
×
UNCOV
358
    if (trick_MM != NULL) {
×
UNCOV
359
        trick_MM->delete_extern_var( name);
×
360
    } else {
UNCOV
361
        Trick::MemoryManager::emitError("TMM_delete_extern_var_n() called before MemoryManager instantiation.\n") ;
×
UNCOV
362
        return;
×
363
    }
364
}
365

366
/**
367
 @relates Trick::MemoryManager
368
 This is the C Language version of Trick::MemoryManager::write_checkpoint( filename).
369
 */
370
extern "C" void TMM_write_checkpoint(const char* filename) {
×
UNCOV
371
    if (trick_MM != NULL) {
×
UNCOV
372
        return ( trick_MM->write_checkpoint( filename));
×
373
    } else {
UNCOV
374
        Trick::MemoryManager::emitError("TMM_write_checkpoint_fn() called before MemoryManager instantiation.\n") ;
×
UNCOV
375
        return;
×
376
    }
377
}
378

379
/**
380
 @relates Trick::MemoryManager
381
 This is the C Language version of Trick::MemoryManager::read_checkpoint( filename).
382
 */
383
extern "C" int TMM_read_checkpoint(const char* filename) {
×
UNCOV
384
    if (trick_MM != NULL) {
×
UNCOV
385
        return ( trick_MM->read_checkpoint( filename ));
×
386
    } else {
UNCOV
387
        Trick::MemoryManager::emitError("TMM_read_checkpoint() called before MemoryManager instantiation.\n") ;
×
UNCOV
388
        return(1);
×
389
    }
390
}
391

392
/**
393
 @relates Trick::MemoryManager
394
 This is the C Language version of Trick::MemoryManager::read_checkpoint_from_string( str).
395
 */
396
extern "C" int TMM_read_checkpoint_from_string(const char* str) {
×
UNCOV
397
    if (trick_MM != NULL) {
×
UNCOV
398
        return ( trick_MM->read_checkpoint_from_string( str ));
×
399
    } else {
400
        Trick::MemoryManager::emitError("TMM_read_checkpoint_from_string() called before MemoryManager instantiation.\n") ;
×
401
        return(1);
×
402
    }
403
}
404

405
/**
406
 @relates Trick::MemoryManager
407
 This is the C Language version of Trick::MemoryManager::init_from_checkpoint( filename).
408
 */
UNCOV
409
extern "C" int TMM_init_from_checkpoint(const char* filename) {
×
UNCOV
410
    if (trick_MM != NULL) {
×
UNCOV
411
        return ( trick_MM->init_from_checkpoint( filename ));
×
412
    } else {
413
        Trick::MemoryManager::emitError("TMM_init_from_checkpoint() called before MemoryManager instantiation.\n") ;
×
414
        return(1);
×
415
    }
416
}
417

418
extern "C" int TMM_set_stl_restore (int on_off) {
×
UNCOV
419
    if (trick_MM != NULL) {
×
UNCOV
420
        return ( trick_MM->set_restore_stls_default( (bool) on_off ));
×
421
    } else {
UNCOV
422
        Trick::MemoryManager::emitError("TMM_set_stl_restore() called before MemoryManager instantiation.\n") ;
×
UNCOV
423
        return(1);
×
424
    }
425
}
426

427
/**
428
 @relates Trick::MemoryManager
429
 This is the C Language version of Trick::MemoryManager::add_shared_library_symbols( filename).
430
 */
431
extern "C" int TMM_add_shared_library_symbols(const char* filename) {
×
UNCOV
432
    if (trick_MM != NULL) {
×
UNCOV
433
        return ( trick_MM->add_shared_library_symbols( filename));
×
434
    } else {
UNCOV
435
        Trick::MemoryManager::emitError("TMM_add_shared_library_symbols() called before MemoryManager instantiation.\n") ;
×
UNCOV
436
        return(1);
×
437
    }
438
}
439

440
/**
441
 @relates Trick::MemoryManager
442
 This is the C Language version of Trick::MemoryManager::add_var( type, stype, var_declare, units).
443
 */
444
extern "C" void* add_var( TRICK_TYPE type, const char* stype, VAR_DECLARE* var_declare, char* units) {
×
UNCOV
445
    if (trick_MM != NULL) {
×
UNCOV
446
        return( trick_MM->add_var(type, stype, var_declare, units ));
×
447
    } else {
UNCOV
448
        Trick::MemoryManager::emitError("add_var() called before MemoryManager instantiation. Returning NULL.\n") ;
×
UNCOV
449
        return ((void*)NULL);
×
450
    }
451
}
452

453
/**
454
 @relates Trick::MemoryManager
455
 This is the C Language version of Trick::MemoryManager::add_vars( type, stype, var_list, units).
456
 */
457
extern "C" int add_vars( TRICK_TYPE type, const char* stype, VAR_LIST* var_list, char* units) {
×
UNCOV
458
    if (trick_MM != NULL) {
×
UNCOV
459
        return( trick_MM->add_vars(type, stype, var_list, units ));
×
460
    } else {
UNCOV
461
        Trick::MemoryManager::emitError("add_vars() called before MemoryManager instantiation.\n") ;
×
UNCOV
462
        return (1);
×
463
    }
464
}
465

466
/**
467
 @relates Trick::MemoryManager::ref_allocate
468
 This is the C Language version of Trick::MemoryManager::ref_allocate( R, num).
469
 */
470
extern "C" int ref_allocate(REF2 *R, int num) {
×
UNCOV
471
    if (trick_MM != NULL) {
×
UNCOV
472
        return( trick_MM->ref_allocate( R, num));
×
473
    } else {
UNCOV
474
        Trick::MemoryManager::emitError("ref_allocate() called before MemoryManager instantiation.\n") ;
×
UNCOV
475
        return (1);
×
476
    }
477
}
478

479
/**
480
 @relates Trick::MemoryManager
481
 This is the C Language version of Trick::MemoryManager::ref_attributes( name).
482
 */
483
extern "C" REF2* ref_attributes(const char* name) {
12,620✔
484
    if (trick_MM != NULL) {
12,620✔
485
        return( trick_MM->ref_attributes( name));
12,620✔
486
    } else {
UNCOV
487
        Trick::MemoryManager::emitError("ref_attributes() called before MemoryManager instantiation. Returning NULL.\n") ;
×
UNCOV
488
        return ( (REF2*)NULL);
×
489
    }
490
}
491

492
/**
493
 @relates Trick::MemoryManager
494
 This is the C Language version of Trick::MemoryManager::ref_assignment( REF2*, V_TREE*).
495
 */
496
extern "C" int ref_assignment(REF2* R, V_TREE* V) {
5✔
497
    if (trick_MM != NULL) {
5✔
498
        return( trick_MM->ref_assignment( R, V));
5✔
499
    } else {
UNCOV
500
        Trick::MemoryManager::emitError("ref_assignment() called before MemoryManager instantiation.\n") ;
×
UNCOV
501
        return (1);
×
502
    }
503
}
504

505
/**
506
 @relates Trick::MemoryManager
507
 This is the C Language version of Trick::MemoryManager::ref_var( REF2*, name).
508
 */
509
extern "C" int ref_var(REF2 *R, char* name) {
×
UNCOV
510
    if (trick_MM != NULL) {
×
UNCOV
511
        return( trick_MM->ref_var( R, name));
×
512
    } else {
UNCOV
513
        Trick::MemoryManager::emitError("ref_var() called before MemoryManager instantiation.\n") ;
×
UNCOV
514
        return (1);
×
515
    }
516
}
517

518
/**
519
 @relates Trick::MemoryManager
520
 This is the C Language version of Trick::MemoryManager::ref_var( REF2*, name).
521
 */
522
extern "C" int get_size(void *addr) {
1,559✔
523
    if (trick_MM != NULL) {
1,559✔
524
        return( trick_MM->get_size( addr));
1,559✔
525
    } else {
UNCOV
526
        Trick::MemoryManager::emitError("get_size() called before MemoryManager instantiation.\n") ;
×
UNCOV
527
        return (0);
×
528
    }
529
}
530

531
/**
532
 @relates Trick::MemoryManager
533
 This is the C Language version of Trick::MemoryManager::get_truncated_size( addr).
534
 */
535
extern "C" int get_truncated_size(void *addr) {
376✔
536
    if (trick_MM != NULL) {
376✔
537
        return( trick_MM->get_truncated_size( addr));
376✔
538
    } else {
UNCOV
539
        Trick::MemoryManager::emitError("get_truncated_size() called before MemoryManager instantiation.\n") ;
×
UNCOV
540
        return (0);
×
541
    }
542
}
543

544
/**
545
 @relates Trick::MemoryManager
546
 This is the C Language version of Trick::MemoryManager::get_truncated_size( ptr).
547
 */
548
extern "C" int io_get_fixed_truncated_size(char *ptr __attribute__ ((unused)),
×
549
                                           ATTRIBUTES * A __attribute__ ((unused)),
550
                                           char *str __attribute__ ((unused)),
551
                                           int dims __attribute__ ((unused)),
552
                                           ATTRIBUTES * left_type __attribute__ ((unused))) {
UNCOV
553
    Trick::MemoryManager::emitError("io_get_fixed_truncated_size() is not implemented yet.\n") ;
×
UNCOV
554
    return(0);
×
555
}
556

557
/**
558
 @relates Trick::MemoryManager
559
 This is the C Language version of Trick::MemoryManager::get_alloc_info_of( addr).
560
 */
561
extern "C" ALLOC_INFO* get_alloc_info_of(void * addr) {
289✔
562
    if (trick_MM != NULL) {
289✔
563
        return( trick_MM->get_alloc_info_of( addr));
289✔
564
    } else {
565
        Trick::MemoryManager::emitError("get_alloc_info_of() called before MemoryManager instantiation.\n") ;
×
566
        return ( (ALLOC_INFO*)NULL);
×
567
    }
568
}
569

570
/**
571
 @relates Trick::MemoryManager
572
 This is the C Language version of Trick::MemoryManager::get_alloc_info_at( addr).
573
 */
574
extern "C" ALLOC_INFO* get_alloc_info_at(void * addr) {
4,040✔
575
    if (trick_MM != NULL) {
4,040✔
576
        return( trick_MM->get_alloc_info_at( addr));
4,040✔
577
    } else {
578
        Trick::MemoryManager::emitError("get_alloc_info_at() called before MemoryManager instantiation.\n") ;
×
579
        return ( (ALLOC_INFO*)NULL);
×
580
    }
581
}
582

583
extern "C" int set_alloc_name_at(void * addr, const char * name ) {
×
UNCOV
584
    if (trick_MM != NULL) {
×
UNCOV
585
        return( trick_MM->set_name_at(addr, name));
×
586
    } else {
UNCOV
587
        Trick::MemoryManager::emitError("get_alloc_info_at() called before MemoryManager instantiation.\n") ;
×
UNCOV
588
        return ( -1 );
×
589
    }
590
}
591

592
/**
593
 @relates Trick::MemoryManager
594
 This is the C Language version of Trick::MemoryManager::get_enumerated(const char* name, V_DATA* v_data).
595
 */
UNCOV
596
extern "C" int get_enumerated(const char* name, V_DATA* v_data) {
×
UNCOV
597
    if (trick_MM != NULL) {
×
UNCOV
598
        return( trick_MM->get_enumerated(name, v_data ));
×
599
    } else {
UNCOV
600
        Trick::MemoryManager::emitError("get_enumerated() called before MemoryManager instantiation.\n") ;
×
UNCOV
601
        return 1 ;
×
602
    }
603
}
604

605
extern "C" void TMM_add_checkpoint_alloc_dependency(const char * name) {
2,687✔
606
    if (trick_MM != NULL) {
2,687✔
607
        trick_MM->add_checkpoint_alloc_dependency(name) ;
2,687✔
608
    }
609
    return ;
2,687✔
610
}
611

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