Pharos
0.7.23
Modern Web Framework & Web App Hosting Service.
Toggle main menu visibility
Loading...
Searching...
No Matches
native_runtime_cleanup.c
Go to the documentation of this file.
1
/**
2
* @file
3
* @brief Implements cleanup helpers for native runtime-owned data structures.
4
*/
5
6
#include "
native_runtime_cleanup.h
"
7
8
#include <stdlib.h>
9
#include <string.h>
10
11
void
free_app_runtime
(
AppRuntime
*app) {
12
free(app->
app_id
);
13
free(app->
app_root
);
14
free(app->
build_dir
);
15
free(app->
artifact_dir
);
16
free(app->
host_profile
);
17
free(app->
compiled_entrypoint
);
18
free(app->
state_path
);
19
free(app->
base_path
);
20
free(app->
log_path
);
21
free(app->
log_format
);
22
free(app->
error_report_path
);
23
free(app->
debug
);
24
free(app->
runtime_conf_path
);
25
memset(app, 0,
sizeof
(*app));
26
}
27
28
void
free_runtime_stack
(
RuntimeStack
*stack) {
29
size_t
index;
30
for
(index = 0; index < stack->
count
; index++) {
31
free_app_runtime
(&stack->
apps
[index]);
32
}
33
free(stack->
host
);
34
free(stack->
port
);
35
free(stack->
socket_path
);
36
memset(stack, 0,
sizeof
(*stack));
37
}
free_runtime_stack
void free_runtime_stack(RuntimeStack *stack)
Releases all loaded app runtimes and listener metadata in a runtime stack.
Definition
native_runtime_cleanup.c:28
free_app_runtime
void free_app_runtime(AppRuntime *app)
Releases heap-owned fields in a loaded app runtime record.
Definition
native_runtime_cleanup.c:11
native_runtime_cleanup.h
Declares cleanup helpers for native runtime-owned data structures.
AppRuntime
Loaded runtime metadata for one Pharos app artifact.
Definition
native_runtime_types.h:37
AppRuntime::build_dir
char * build_dir
Definition
native_runtime_types.h:40
AppRuntime::error_report_path
char * error_report_path
Definition
native_runtime_types.h:48
AppRuntime::debug
char * debug
Definition
native_runtime_types.h:49
AppRuntime::artifact_dir
char * artifact_dir
Definition
native_runtime_types.h:41
AppRuntime::base_path
char * base_path
Definition
native_runtime_types.h:45
AppRuntime::app_id
char * app_id
Definition
native_runtime_types.h:38
AppRuntime::compiled_entrypoint
char * compiled_entrypoint
Definition
native_runtime_types.h:43
AppRuntime::app_root
char * app_root
Definition
native_runtime_types.h:39
AppRuntime::host_profile
char * host_profile
Definition
native_runtime_types.h:42
AppRuntime::state_path
char * state_path
Definition
native_runtime_types.h:44
AppRuntime::log_format
char * log_format
Definition
native_runtime_types.h:47
AppRuntime::log_path
char * log_path
Definition
native_runtime_types.h:46
AppRuntime::runtime_conf_path
char * runtime_conf_path
Definition
native_runtime_types.h:50
RuntimeStack
In-memory collection of loaded app runtimes served by one listener.
Definition
native_runtime_types.h:56
RuntimeStack::host
char * host
Definition
native_runtime_types.h:59
RuntimeStack::apps
AppRuntime apps[MAX_APPS]
Definition
native_runtime_types.h:57
RuntimeStack::count
size_t count
Definition
native_runtime_types.h:58
RuntimeStack::socket_path
char * socket_path
Definition
native_runtime_types.h:61
RuntimeStack::port
char * port
Definition
native_runtime_types.h:60
src
native_runtime
c
native_runtime_cleanup.c
Generated by
1.17.0