-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsharedptrfwd.h
More file actions
72 lines (57 loc) · 1.41 KB
/
sharedptrfwd.h
File metadata and controls
72 lines (57 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
//
// Created by Surya on 13-04-2024
//
/**
* @file sharedptrfwd.inl
* @brief Header file for shared pointer functionality with Grbage Collection
* @date 13-04-2024
*/
#ifndef SHARED_PTR_F
#define SHARED_PTR_F
#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
#include <stdbool.h>
#include <stdarg.h>
#include <string.h>
#include <unistd.h>
#include <windows.h>
#include <time.h>
#include <pthread.h>
#ifndef _ALLOCATION_SHARED
#define _ALLOCATION_SHARED
#define _SUPPRESS_UNUSED __attribute__((unused))
#ifndef PROGRAM_LOG_GEN
#define PROGRAM_LOG_GEN
#endif
typedef struct _shared_allocator_build {
void* acnt;
size_t ref_cnt : 30;
int static_cnt : 10;
struct _shared_allocator_build** _collector[32];
struct _shared_allocator_build* _ust;
}synchronized_ptr;
#endif
#ifndef _SHARED_DECL
#define _SHARED_DECL __cdecl
#endif
#define __forever__ 1
typedef synchronized_ptr* shared_ptr;
_SHARED_DECL __attribute__ ((__pure__))
synchronized_ptr* sync_with_dynamic_allocator(int _Size);
#ifndef SHARED_ATTRIBUTE_SYNCHRONIZED_CONTROLLER
#define SYNCHRONIZED_CONTROLLER
#endif
_SHARED_DECL
void allocator_load(synchronized_ptr** _adrs);
_SHARED_DECL
void move_ref(synchronized_ptr** _Src, synchronized_ptr** _Dest);
struct _mem_tf_info {
int _mem_arr[32];
int cnt;
};
_SUPPRESS_UNUSED
struct _mem_tf_info get_memory_ref_count();
_SHARED_DECL
void sharedAdjList();
#endif // SHARED_PTR_F