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

nasa / trick / 18506050876

14 Oct 2025 06:17PM UTC coverage: 55.818% (-0.004%) from 55.822%
18506050876

Pull #1942

github

web-flow
Merge 922bf3ddc into 6ff28150d
Pull Request #1942: Adding additional updates to PR#1847

42 of 81 new or added lines in 2 files covered. (51.85%)

129 existing lines in 6 files now uncovered.

12401 of 22217 relevant lines covered (55.82%)

252363.25 hits per line

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

26.43
/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) {
18✔
15
    if (trick_MM != NULL) {
18✔
16
        std::string sclass_name = class_name;
36✔
17
        std::string svar_name = var_name;
18✔
18
        return ( trick_MM->declare_var( type, sclass_name, n_stars, svar_name, n_cdims, cdims));
18✔
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) {
781✔
31
    if (trick_MM != NULL) {
781✔
32
        return ( trick_MM->declare_var( enh_type_spec, e_elems));
781✔
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) {
2,835✔
45
    if (trick_MM != NULL) {
2,835✔
46
        return ( trick_MM->declare_var( declaration));
2,835✔
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

83
/**
84
 @relates Trick::MemoryManager
85
 This is the C Language version of the 7 argument version of Trick::MemoryManager::declare_ext_var.
86
 The arguments and return value are the same except that std::string args are replaced with const char * args.
87
 */
88
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,746✔
89
    if (trick_MM != NULL) {
4,746✔
90
        std::string sclass_name = class_name;
9,492✔
91
        std::string svar_name = var_name;
4,746✔
92
        return ( trick_MM->declare_extern_var( addr, type, sclass_name, n_stars, svar_name, n_cdims, cdims));
4,746✔
93
    } else {
UNCOV
94
        Trick::MemoryManager::emitError("TMM_declare_ext_var() called before MemoryManager instantiation. Returning NULL.\n") ;
×
UNCOV
95
        return ( (void*)NULL);
×
96
    }
97
}
98

99
/**
100
 @relates Trick::MemoryManager
101
 This is the C Language version of the 4 argument version of Trick::MemoryManager::declare_var.
102
 The arguments and return value are the same.
103
 */
104
extern "C" void* TMM_declare_ext_var_1d( void* addr, const char* elem_decl, int n_elems) {
×
UNCOV
105
    if (trick_MM != NULL) {
×
UNCOV
106
        return ( trick_MM->declare_extern_var( addr, elem_decl, n_elems));
×
107
    } else {
UNCOV
108
        Trick::MemoryManager::emitError("TMM_declare_ext_var_1d() called before MemoryManager instantiation. Returning NULL.\n") ;
×
UNCOV
109
        return ( (void*)NULL);
×
110
    }
111
}
112

113
/**
114
 @relates Trick::MemoryManager
115
 This is the C Language version of the 1 argument version of Trick::MemoryManager::declare_extern_var.
116
 The arguments and return value are the same.
117
 */
118
extern "C" void* TMM_declare_ext_var_s( void* addr, const char* declaration) {
×
UNCOV
119
    if (trick_MM != NULL) {
×
UNCOV
120
        return ( trick_MM->declare_extern_var(addr, declaration));
×
121
    } else {
UNCOV
122
        Trick::MemoryManager::emitError("TMM_declare_ext_var_s() called before MemoryManager instantiation. Returning NULL.\n") ;
×
UNCOV
123
        return ( (void*)NULL);
×
124
    }
125
}
126

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

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

159
/**
160
 @relates Trick::MemoryManager
161
 This is the C Language version of Trick::MemoryManager::resize_array(address, num).
162
 Resize the one dimensional array at the given address.
163
 */
164
void* TMM_resize_array_1d_a(void* address, int num){
36✔
165
    if (trick_MM != NULL) {
36✔
166
        return ( trick_MM->resize_array(address, num));
36✔
167
    } else {
UNCOV
168
        Trick::MemoryManager::emitError("TMM_resize_array_1d_a() called before MemoryManager instantiation. Returning NULL.\n") ;
×
UNCOV
169
        return ( (void*)NULL);
×
170
    }
171
}
172

173
/**
174
 @relates Trick::MemoryManager
175
 This is the C Language version of Trick::MemoryManager::resize_array(name, num).
176
 Resize the one dimensional array whose name is given.
177
 */
178
void* TMM_resize_array_1d_n(const char *name, int num){
×
UNCOV
179
    if (trick_MM != NULL) {
×
UNCOV
180
        return ( trick_MM->resize_array(name, num));
×
181
    } else {
UNCOV
182
        Trick::MemoryManager::emitError("TMM_resize_array_1d_n() called before MemoryManager instantiation. Returning NULL.\n") ;
×
UNCOV
183
        return ( (void*)NULL);
×
184
    }
185
}
186

187
/**
188
 @relates Trick::MemoryManager
189
 This is the C Language version of Trick::MemoryManager::mm_strdup( str).
190
 Duplicate and catalog the given character string.
191
 */
192
extern "C" char* TMM_strdup(char *str) {
709✔
193
    if (trick_MM != NULL) {
709✔
194
        return ( trick_MM->mm_strdup( str));
709✔
195
    } else {
UNCOV
196
        Trick::MemoryManager::emitError("TMM_strdup called before MemoryManager instantiation. Returning NULL.\n") ;
×
UNCOV
197
        return( (char*)NULL);
×
198
    }
199
}
200

201
/**
202
 @relates Trick::MemoryManager
203
 This is the C Language version of Trick::MemoryManager::var_exists().
204
 Test whether the given variable_name is in use.
205
 */
206
extern "C" int TMM_var_exists( const char* var_name) {
40✔
207
    if (trick_MM != NULL) {
40✔
208
        std::string svar_name = var_name;
40✔
209
        return ( trick_MM->var_exists( svar_name));
40✔
210
    } else {
UNCOV
211
        Trick::MemoryManager::emitError("TMM_var_exists() called before MemoryManager instantiation.\n") ;
×
UNCOV
212
        return (0);
×
213
    }
214
}
215

216
/**
217
 @relates Trick::MemoryManager
218
 This is the C Language version of Trick::MemoryManager::var_exists().
219
 Test whether the given address is in Trick managed memory.  C interface to Trick::MemoryManager::is_alloced( addr).
220
 */
221
extern "C" int TMM_is_alloced(char *addr) {
381✔
222
    if (trick_MM != NULL) {
381✔
223
        return ( trick_MM->is_alloced( addr));
381✔
224
    } else {
UNCOV
225
        Trick::MemoryManager::emitError("TMM_is_alloced() called before MemoryManager instantiation.\n") ;
×
UNCOV
226
        return (0);
×
227
    }
228
}
229

230
/**
231
 @relates Trick::MemoryManager
232
 This is the C Language version of Trick::MemoryManager::set_debug_level(level).
233
 Set the verbosity of MemoryManager debug messages.  C interface to Trick::MemoryManager::set_debug_level( level).
234
 */
235
extern "C" void TMM_set_debug_level(int level) {
×
UNCOV
236
    if (trick_MM != NULL) {
×
UNCOV
237
        trick_MM->set_debug_level( level);
×
238
    } else {
UNCOV
239
        Trick::MemoryManager::emitError("TMM_set_debug_level() called before MemoryManager instantiation.\n") ;
×
240
    }
UNCOV
241
}
×
242

243
/**
244
 This is the C Language version of Trick::MemoryManager::set_reduced_checkpoint( yesno).
245
 @relates Trick::MemoryManager
246
 */
UNCOV
247
extern "C" void TMM_reduced_checkpoint(int yesno) {
×
248
    if (trick_MM != NULL) {
×
UNCOV
249
        trick_MM->set_reduced_checkpoint( yesno!=0 );
×
250
    } else {
UNCOV
251
        Trick::MemoryManager::emitError("TMM_reduced_checkpoint() called before MemoryManager instantiation.\n") ;
×
252
    }
UNCOV
253
}
×
254

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

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

279
/**
280
 @relates Trick::MemoryManager
281
 This is the C Language version of Trick::MemoryManager::clear_var( addr).
282
 */
UNCOV
283
extern "C" void TMM_clear_var_a(void *addr) {
×
284
    if (trick_MM != NULL) {
×
UNCOV
285
        trick_MM->clear_var( addr);
×
286
    } else {
UNCOV
287
        Trick::MemoryManager::emitError("TMM_clear_var_a() called before MemoryManager instantiation.\n") ;
×
UNCOV
288
        return;
×
289
    }
290
}
291

292
/**
293
 @relates Trick::MemoryManager
294
 This is the C Language version of Trick::MemoryManager::clear_var( name).
295
 */
296
extern "C" void TMM_clear_var_n( const char* name) {
×
297
    if (trick_MM != NULL) {
×
UNCOV
298
        trick_MM->clear_var( name);
×
299
    } else {
UNCOV
300
        Trick::MemoryManager::emitError("TMM_clear_var_n() called before MemoryManager instantiation.\n") ;
×
UNCOV
301
        return;
×
302
    }
303
}
304

305
/**
306
 @relates Trick::MemoryManager
307
 This is the C Language version of Trick::MemoryManager::delete_var( addr).
308
 */
309
extern "C" void TMM_delete_var_a(void *addr) {
359✔
310
    if (trick_MM != NULL) {
359✔
311
        trick_MM->delete_var( addr);
359✔
312
    } else {
UNCOV
313
        Trick::MemoryManager::emitError("TMM_delete_var_a() called before MemoryManager instantiation.\n") ;
×
UNCOV
314
        return;
×
315
    }
316
}
317

318
/**
319
 @relates Trick::MemoryManager
320
 This is the C Language version of Trick::MemoryManager::delete_var( name).
321
 */
322
extern "C" void TMM_delete_var_n( const char* name) {
1,764✔
323
    if (trick_MM != NULL) {
1,764✔
324
        trick_MM->delete_var( name);
1,764✔
325
    } else {
UNCOV
326
        Trick::MemoryManager::emitError("TMM_delete_var_n() called before MemoryManager instantiation.\n") ;
×
UNCOV
327
        return;
×
328
    }
329
}
330

331
/**
332
 @relates Trick::MemoryManager
333
 This is the C Language version of Trick::MemoryManager::delete_extern_var( addr).
334
 */
335
extern "C" void TMM_delete_extern_var_a(void *addr) {
×
336
    if (trick_MM != NULL) {
×
UNCOV
337
        trick_MM->delete_extern_var( addr);
×
338
    } else {
UNCOV
339
        Trick::MemoryManager::emitError("TMM_delete_extern_var_a() called before MemoryManager instantiation.\n") ;
×
UNCOV
340
        return;
×
341
    }
342
}
343

344
/**
345
 @relates Trick::MemoryManager
346
 This is the C Language version of Trick::MemoryManager::delete_extern_var( name).
347
 */
348
extern "C" void TMM_delete_extern_var_n( const char* name) {
×
349
    if (trick_MM != NULL) {
×
UNCOV
350
        trick_MM->delete_extern_var( name);
×
351
    } else {
UNCOV
352
        Trick::MemoryManager::emitError("TMM_delete_extern_var_n() called before MemoryManager instantiation.\n") ;
×
UNCOV
353
        return;
×
354
    }
355
}
356

357
/**
358
 @relates Trick::MemoryManager
359
 This is the C Language version of Trick::MemoryManager::write_checkpoint( filename).
360
 */
361
extern "C" void TMM_write_checkpoint(const char* filename) {
×
362
    if (trick_MM != NULL) {
×
UNCOV
363
        return ( trick_MM->write_checkpoint( filename));
×
364
    } else {
UNCOV
365
        Trick::MemoryManager::emitError("TMM_write_checkpoint_fn() called before MemoryManager instantiation.\n") ;
×
UNCOV
366
        return;
×
367
    }
368
}
369

370
/**
371
 @relates Trick::MemoryManager
372
 This is the C Language version of Trick::MemoryManager::read_checkpoint( filename).
373
 */
374
extern "C" int TMM_read_checkpoint(const char* filename) {
×
375
    if (trick_MM != NULL) {
×
UNCOV
376
        return ( trick_MM->read_checkpoint( filename ));
×
377
    } else {
UNCOV
378
        Trick::MemoryManager::emitError("TMM_read_checkpoint() called before MemoryManager instantiation.\n") ;
×
UNCOV
379
        return(1);
×
380
    }
381
}
382

383
/**
384
 @relates Trick::MemoryManager
385
 This is the C Language version of Trick::MemoryManager::read_checkpoint_from_string( str).
386
 */
387
extern "C" int TMM_read_checkpoint_from_string(const char* str) {
×
388
    if (trick_MM != NULL) {
×
UNCOV
389
        return ( trick_MM->read_checkpoint_from_string( str ));
×
390
    } else {
UNCOV
391
        Trick::MemoryManager::emitError("TMM_read_checkpoint_from_string() called before MemoryManager instantiation.\n") ;
×
UNCOV
392
        return(1);
×
393
    }
394
}
395

396
/**
397
 @relates Trick::MemoryManager
398
 This is the C Language version of Trick::MemoryManager::init_from_checkpoint( filename).
399
 */
400
extern "C" int TMM_init_from_checkpoint(const char* filename) {
×
401
    if (trick_MM != NULL) {
×
UNCOV
402
        return ( trick_MM->init_from_checkpoint( filename ));
×
403
    } else {
UNCOV
404
        Trick::MemoryManager::emitError("TMM_init_from_checkpoint() called before MemoryManager instantiation.\n") ;
×
UNCOV
405
        return(1);
×
406
    }
407
}
408

409
extern "C" int TMM_set_stl_restore (int on_off) {
×
410
    if (trick_MM != NULL) {
×
411
        return ( trick_MM->set_restore_stls_default( (bool) on_off ));
×
412
    } else {
413
        Trick::MemoryManager::emitError("TMM_set_stl_restore() called before MemoryManager instantiation.\n") ;
×
414
        return(1);
×
415
    }
416
}
417

418
/**
419
 @relates Trick::MemoryManager
420
 This is the C Language version of Trick::MemoryManager::add_shared_library_symbols( filename).
421
 */
422
extern "C" int TMM_add_shared_library_symbols(const char* filename) {
×
423
    if (trick_MM != NULL) {
×
UNCOV
424
        return ( trick_MM->add_shared_library_symbols( filename));
×
425
    } else {
UNCOV
426
        Trick::MemoryManager::emitError("TMM_add_shared_library_symbols() called before MemoryManager instantiation.\n") ;
×
UNCOV
427
        return(1);
×
428
    }
429
}
430

431
/**
432
 @relates Trick::MemoryManager
433
 This is the C Language version of Trick::MemoryManager::add_var( type, stype, var_declare, units).
434
 */
435
extern "C" void* add_var( TRICK_TYPE type, const char* stype, VAR_DECLARE* var_declare, char* units) {
×
436
    if (trick_MM != NULL) {
×
UNCOV
437
        return( trick_MM->add_var(type, stype, var_declare, units ));
×
438
    } else {
UNCOV
439
        Trick::MemoryManager::emitError("add_var() called before MemoryManager instantiation. Returning NULL.\n") ;
×
UNCOV
440
        return ((void*)NULL);
×
441
    }
442
}
443

444
/**
445
 @relates Trick::MemoryManager
446
 This is the C Language version of Trick::MemoryManager::add_vars( type, stype, var_list, units).
447
 */
448
extern "C" int add_vars( TRICK_TYPE type, const char* stype, VAR_LIST* var_list, char* units) {
×
449
    if (trick_MM != NULL) {
×
UNCOV
450
        return( trick_MM->add_vars(type, stype, var_list, units ));
×
451
    } else {
UNCOV
452
        Trick::MemoryManager::emitError("add_vars() called before MemoryManager instantiation.\n") ;
×
UNCOV
453
        return (1);
×
454
    }
455
}
456

457
/**
458
 @relates Trick::MemoryManager::ref_allocate
459
 This is the C Language version of Trick::MemoryManager::ref_allocate( R, num).
460
 */
461
extern "C" int ref_allocate(REF2 *R, int num) {
×
462
    if (trick_MM != NULL) {
×
UNCOV
463
        return( trick_MM->ref_allocate( R, num));
×
464
    } else {
UNCOV
465
        Trick::MemoryManager::emitError("ref_allocate() called before MemoryManager instantiation.\n") ;
×
UNCOV
466
        return (1);
×
467
    }
468
}
469

470
/**
471
 @relates Trick::MemoryManager
472
 This is the C Language version of Trick::MemoryManager::ref_attributes( name).
473
 */
474
extern "C" REF2* ref_attributes(const char* name) {
12,272✔
475
    if (trick_MM != NULL) {
12,272✔
476
        return( trick_MM->ref_attributes( name));
12,272✔
477
    } else {
UNCOV
478
        Trick::MemoryManager::emitError("ref_attributes() called before MemoryManager instantiation. Returning NULL.\n") ;
×
UNCOV
479
        return ( (REF2*)NULL);
×
480
    }
481
}
482

483
/**
484
 @relates Trick::MemoryManager
485
 This is the C Language version of Trick::MemoryManager::ref_assignment( REF2*, V_TREE*).
486
 */
487
extern "C" int ref_assignment(REF2* R, V_TREE* V) {
5✔
488
    if (trick_MM != NULL) {
5✔
489
        return( trick_MM->ref_assignment( R, V));
5✔
490
    } else {
UNCOV
491
        Trick::MemoryManager::emitError("ref_assignment() called before MemoryManager instantiation.\n") ;
×
UNCOV
492
        return (1);
×
493
    }
494
}
495

496
/**
497
 @relates Trick::MemoryManager
498
 This is the C Language version of Trick::MemoryManager::ref_var( REF2*, name).
499
 */
500
extern "C" int ref_var(REF2 *R, char* name) {
×
501
    if (trick_MM != NULL) {
×
UNCOV
502
        return( trick_MM->ref_var( R, name));
×
503
    } else {
UNCOV
504
        Trick::MemoryManager::emitError("ref_var() called before MemoryManager instantiation.\n") ;
×
UNCOV
505
        return (1);
×
506
    }
507
}
508

509
/**
510
 @relates Trick::MemoryManager
511
 This is the C Language version of Trick::MemoryManager::ref_var( REF2*, name).
512
 */
513
extern "C" int get_size(void *addr) {
1,393✔
514
    if (trick_MM != NULL) {
1,393✔
515
        return( trick_MM->get_size( addr));
1,393✔
516
    } else {
UNCOV
517
        Trick::MemoryManager::emitError("get_size() called before MemoryManager instantiation.\n") ;
×
UNCOV
518
        return (0);
×
519
    }
520
}
521

522
/**
523
 @relates Trick::MemoryManager
524
 This is the C Language version of Trick::MemoryManager::get_truncated_size( addr).
525
 */
526
extern "C" int get_truncated_size(void *addr) {
541✔
527
    if (trick_MM != NULL) {
541✔
528
        return( trick_MM->get_truncated_size( addr));
541✔
529
    } else {
UNCOV
530
        Trick::MemoryManager::emitError("get_truncated_size() called before MemoryManager instantiation.\n") ;
×
UNCOV
531
        return (0);
×
532
    }
533
}
534

535
/**
536
 @relates Trick::MemoryManager
537
 This is the C Language version of Trick::MemoryManager::get_truncated_size( ptr).
538
 */
539
extern "C" int io_get_fixed_truncated_size(char *ptr __attribute__ ((unused)),
×
540
                                           ATTRIBUTES * A __attribute__ ((unused)),
541
                                           char *str __attribute__ ((unused)),
542
                                           int dims __attribute__ ((unused)),
543
                                           ATTRIBUTES * left_type __attribute__ ((unused))) {
UNCOV
544
    Trick::MemoryManager::emitError("io_get_fixed_truncated_size() is not implemented yet.\n") ;
×
UNCOV
545
    return(0);
×
546
}
547

548
/**
549
 @relates Trick::MemoryManager
550
 This is the C Language version of Trick::MemoryManager::get_alloc_info_of( addr).
551
 */
552
extern "C" ALLOC_INFO* get_alloc_info_of(void * addr) {
289✔
553
    if (trick_MM != NULL) {
289✔
554
        return( trick_MM->get_alloc_info_of( addr));
289✔
555
    } else {
UNCOV
556
        Trick::MemoryManager::emitError("get_alloc_info_of() called before MemoryManager instantiation.\n") ;
×
UNCOV
557
        return ( (ALLOC_INFO*)NULL);
×
558
    }
559
}
560

561
/**
562
 @relates Trick::MemoryManager
563
 This is the C Language version of Trick::MemoryManager::get_alloc_info_at( addr).
564
 */
565
extern "C" ALLOC_INFO* get_alloc_info_at(void * addr) {
3,996✔
566
    if (trick_MM != NULL) {
3,996✔
567
        return( trick_MM->get_alloc_info_at( addr));
3,996✔
568
    } else {
UNCOV
569
        Trick::MemoryManager::emitError("get_alloc_info_at() called before MemoryManager instantiation.\n") ;
×
UNCOV
570
        return ( (ALLOC_INFO*)NULL);
×
571
    }
572
}
573

UNCOV
574
extern "C" int set_alloc_name_at(void * addr, const char * name ) {
×
UNCOV
575
    if (trick_MM != NULL) {
×
UNCOV
576
        return( trick_MM->set_name_at(addr, name));
×
577
    } else {
578
        Trick::MemoryManager::emitError("get_alloc_info_at() called before MemoryManager instantiation.\n") ;
×
579
        return ( -1 );
×
580
    }
581
}
582

583
/**
584
 @relates Trick::MemoryManager
585
 This is the C Language version of Trick::MemoryManager::get_enumerated(const char* name, V_DATA* v_data).
586
 */
587
extern "C" int get_enumerated(const char* name, V_DATA* v_data) {
×
588
    if (trick_MM != NULL) {
×
UNCOV
589
        return( trick_MM->get_enumerated(name, v_data ));
×
590
    } else {
UNCOV
591
        Trick::MemoryManager::emitError("get_enumerated() called before MemoryManager instantiation.\n") ;
×
UNCOV
592
        return 1 ;
×
593
    }
594
}
595

596
extern "C" void TMM_add_checkpoint_alloc_dependency(const char * name) {
2,498✔
597
    if (trick_MM != NULL) {
2,498✔
598
        trick_MM->add_checkpoint_alloc_dependency(name) ;
2,498✔
599
    }
600
    return ;
2,498✔
601
}
602

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