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

nasa / trick / 18506258460

14 Oct 2025 06:25PM UTC coverage: 55.802% (-0.02%) from 55.826%
18506258460

push

github

web-flow
Added an optional alloc_name string parameter to declare_operatornew_var function also a new call in the C interface. (#1973)

0 of 9 new or added lines in 2 files covered. (0.0%)

4 existing lines in 2 files now uncovered.

12358 of 22146 relevant lines covered (55.8%)

255975.98 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) {
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

NEW
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 ) {
×
NEW
84
    if (trick_MM != NULL) {
×
NEW
85
        return trick_MM->declare_operatornew_var( std::string(class_name), alloc_size, element_size, std::string(alloc_name) ) ;
×
86
    } else {
NEW
87
        Trick::MemoryManager::emitError("TMM_declare_var() called before MemoryManager instantiation. Returning NULL.\n") ;
×
NEW
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,746✔
98
    if (trick_MM != NULL) {
4,746✔
99
        std::string sclass_name = class_name;
9,492✔
100
        std::string svar_name = var_name;
4,746✔
101
        return ( trick_MM->declare_extern_var( addr, type, sclass_name, n_stars, svar_name, n_cdims, cdims));
4,746✔
102
    } else {
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
 */
113
extern "C" void* TMM_declare_ext_var_1d( void* addr, const char* elem_decl, int n_elems) {
×
114
    if (trick_MM != NULL) {
×
115
        return ( trick_MM->declare_extern_var( addr, elem_decl, n_elems));
×
116
    } else {
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
 */
127
extern "C" void* TMM_declare_ext_var_s( void* addr, const char* declaration) {
×
128
    if (trick_MM != NULL) {
×
129
        return ( trick_MM->declare_extern_var(addr, declaration));
×
130
    } else {
131
        Trick::MemoryManager::emitError("TMM_declare_ext_var_s() called before MemoryManager instantiation. Returning NULL.\n") ;
×
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
 */
143
void* TMM_resize_array_a(void *address, int n_cdims, int *cdims){
×
144
    if (trick_MM != NULL) {
×
145
        return ( trick_MM->resize_array(address, n_cdims, cdims));
×
146
    } else {
147
        Trick::MemoryManager::emitError("TMM_resize_array_a() called before MemoryManager instantiation. Returning NULL.\n") ;
×
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
 */
159
void* TMM_resize_array_n(const char *name, int n_cdims, int *cdims){
×
160
    if (trick_MM != NULL) {
×
161
        return ( trick_MM->resize_array(name, n_cdims, cdims));
×
162
    } else {
163
        Trick::MemoryManager::emitError("TMM_resize_array_n() called before MemoryManager instantiation. Returning NULL.\n") ;
×
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 {
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
 */
187
void* TMM_resize_array_1d_n(const char *name, int num){
×
188
    if (trick_MM != NULL) {
×
189
        return ( trick_MM->resize_array(name, num));
×
190
    } else {
191
        Trick::MemoryManager::emitError("TMM_resize_array_1d_n() called before MemoryManager instantiation. Returning NULL.\n") ;
×
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) {
709✔
202
    if (trick_MM != NULL) {
709✔
203
        return ( trick_MM->mm_strdup( str));
709✔
204
    } else {
205
        Trick::MemoryManager::emitError("TMM_strdup called before MemoryManager instantiation. Returning NULL.\n") ;
×
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) {
40✔
216
    if (trick_MM != NULL) {
40✔
217
        std::string svar_name = var_name;
40✔
218
        return ( trick_MM->var_exists( svar_name));
40✔
219
    } else {
220
        Trick::MemoryManager::emitError("TMM_var_exists() called before MemoryManager instantiation.\n") ;
×
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) {
382✔
231
    if (trick_MM != NULL) {
382✔
232
        return ( trick_MM->is_alloced( addr));
382✔
233
    } else {
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
 */
244
extern "C" void TMM_set_debug_level(int level) {
×
245
    if (trick_MM != NULL) {
×
246
        trick_MM->set_debug_level( level);
×
247
    } else {
248
        Trick::MemoryManager::emitError("TMM_set_debug_level() called before MemoryManager instantiation.\n") ;
×
249
    }
250
}
×
251

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

264
/**
265
 @relates Trick::MemoryManager
266
 This is the C Language version of Trick::MemoryManager::set_hexfloat_checkpoint( yesno).
267
 */
268
extern "C" void TMM_hexfloat_checkpoint(int yesno) {
×
269
    if (trick_MM != NULL) {
×
270
        trick_MM->set_hexfloat_checkpoint( yesno!=0 );
×
271
    } else {
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
 */
280
extern "C" void TMM_hexfloat_decimal_comment_checkpoint(int yesno) {
×
281
    if (trick_MM != NULL) {
×
282
        trick_MM->set_hexfloat_decimal_comment_checkpoint( yesno!=0 );
×
283
    } else {
284
        Trick::MemoryManager::emitError("TMM_hexfloat_decimal_comment_checkpoint() called before MemoryManager instantiation.\n") ;
×
285
    }
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) {
×
293
    if (trick_MM != NULL) {
×
294
        trick_MM->clear_var( addr);
×
295
    } else {
296
        Trick::MemoryManager::emitError("TMM_clear_var_a() called before MemoryManager instantiation.\n") ;
×
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) {
×
306
    if (trick_MM != NULL) {
×
307
        trick_MM->clear_var( name);
×
308
    } else {
309
        Trick::MemoryManager::emitError("TMM_clear_var_n() called before MemoryManager instantiation.\n") ;
×
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) {
362✔
319
    if (trick_MM != NULL) {
362✔
320
        trick_MM->delete_var( addr);
362✔
321
    } else {
322
        Trick::MemoryManager::emitError("TMM_delete_var_a() called before MemoryManager instantiation.\n") ;
×
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,764✔
332
    if (trick_MM != NULL) {
1,764✔
333
        trick_MM->delete_var( name);
1,764✔
334
    } else {
335
        Trick::MemoryManager::emitError("TMM_delete_var_n() called before MemoryManager instantiation.\n") ;
×
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) {
×
345
    if (trick_MM != NULL) {
×
346
        trick_MM->delete_extern_var( addr);
×
347
    } else {
348
        Trick::MemoryManager::emitError("TMM_delete_extern_var_a() called before MemoryManager instantiation.\n") ;
×
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) {
×
358
    if (trick_MM != NULL) {
×
359
        trick_MM->delete_extern_var( name);
×
360
    } else {
361
        Trick::MemoryManager::emitError("TMM_delete_extern_var_n() called before MemoryManager instantiation.\n") ;
×
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) {
×
371
    if (trick_MM != NULL) {
×
372
        return ( trick_MM->write_checkpoint( filename));
×
373
    } else {
374
        Trick::MemoryManager::emitError("TMM_write_checkpoint_fn() called before MemoryManager instantiation.\n") ;
×
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) {
×
384
    if (trick_MM != NULL) {
×
385
        return ( trick_MM->read_checkpoint( filename ));
×
386
    } else {
387
        Trick::MemoryManager::emitError("TMM_read_checkpoint() called before MemoryManager instantiation.\n") ;
×
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) {
×
397
    if (trick_MM != NULL) {
×
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
 */
409
extern "C" int TMM_init_from_checkpoint(const char* filename) {
×
410
    if (trick_MM != NULL) {
×
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) {
×
419
    if (trick_MM != NULL) {
×
420
        return ( trick_MM->set_restore_stls_default( (bool) on_off ));
×
421
    } else {
422
        Trick::MemoryManager::emitError("TMM_set_stl_restore() called before MemoryManager instantiation.\n") ;
×
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) {
×
432
    if (trick_MM != NULL) {
×
433
        return ( trick_MM->add_shared_library_symbols( filename));
×
434
    } else {
435
        Trick::MemoryManager::emitError("TMM_add_shared_library_symbols() called before MemoryManager instantiation.\n") ;
×
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) {
×
445
    if (trick_MM != NULL) {
×
446
        return( trick_MM->add_var(type, stype, var_declare, units ));
×
447
    } else {
448
        Trick::MemoryManager::emitError("add_var() called before MemoryManager instantiation. Returning NULL.\n") ;
×
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) {
×
458
    if (trick_MM != NULL) {
×
459
        return( trick_MM->add_vars(type, stype, var_list, units ));
×
460
    } else {
461
        Trick::MemoryManager::emitError("add_vars() called before MemoryManager instantiation.\n") ;
×
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) {
×
471
    if (trick_MM != NULL) {
×
472
        return( trick_MM->ref_allocate( R, num));
×
473
    } else {
474
        Trick::MemoryManager::emitError("ref_allocate() called before MemoryManager instantiation.\n") ;
×
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,272✔
484
    if (trick_MM != NULL) {
12,272✔
485
        return( trick_MM->ref_attributes( name));
12,272✔
486
    } else {
487
        Trick::MemoryManager::emitError("ref_attributes() called before MemoryManager instantiation. Returning NULL.\n") ;
×
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 {
500
        Trick::MemoryManager::emitError("ref_assignment() called before MemoryManager instantiation.\n") ;
×
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) {
×
510
    if (trick_MM != NULL) {
×
511
        return( trick_MM->ref_var( R, name));
×
512
    } else {
513
        Trick::MemoryManager::emitError("ref_var() called before MemoryManager instantiation.\n") ;
×
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,393✔
523
    if (trick_MM != NULL) {
1,393✔
524
        return( trick_MM->get_size( addr));
1,393✔
525
    } else {
526
        Trick::MemoryManager::emitError("get_size() called before MemoryManager instantiation.\n") ;
×
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) {
541✔
536
    if (trick_MM != NULL) {
541✔
537
        return( trick_MM->get_truncated_size( addr));
541✔
538
    } else {
539
        Trick::MemoryManager::emitError("get_truncated_size() called before MemoryManager instantiation.\n") ;
×
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))) {
553
    Trick::MemoryManager::emitError("io_get_fixed_truncated_size() is not implemented yet.\n") ;
×
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) {
3,996✔
575
    if (trick_MM != NULL) {
3,996✔
576
        return( trick_MM->get_alloc_info_at( addr));
3,996✔
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 ) {
×
584
    if (trick_MM != NULL) {
×
585
        return( trick_MM->set_name_at(addr, name));
×
586
    } else {
587
        Trick::MemoryManager::emitError("get_alloc_info_at() called before MemoryManager instantiation.\n") ;
×
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
 */
596
extern "C" int get_enumerated(const char* name, V_DATA* v_data) {
×
597
    if (trick_MM != NULL) {
×
598
        return( trick_MM->get_enumerated(name, v_data ));
×
599
    } else {
600
        Trick::MemoryManager::emitError("get_enumerated() called before MemoryManager instantiation.\n") ;
×
601
        return 1 ;
×
602
    }
603
}
604

605
extern "C" void TMM_add_checkpoint_alloc_dependency(const char * name) {
2,498✔
606
    if (trick_MM != NULL) {
2,498✔
607
        trick_MM->add_checkpoint_alloc_dependency(name) ;
2,498✔
608
    }
609
    return ;
2,498✔
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