OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
stacksize_c.c File Reference
#include "hardware.inc"
#include <stdio.h>
#include <sys/resource.h>

Go to the source code of this file.

Macros

#define _FCALL

Functions

void set_stack_c_ (int *stack)
void set_stack_c__ (int *stack)
void _FCALL SET_STACK_C (int *stack)

Macro Definition Documentation

◆ _FCALL

#define _FCALL

Definition at line 27 of file stacksize_c.c.

Function Documentation

◆ SET_STACK_C()

void _FCALL SET_STACK_C ( int * stack)

Definition at line 78 of file stacksize_c.c.

78 {
79 set_stack_c_(stack);
80
81 }
void set_stack_c_(int *stack)
Definition stacksize_c.c:40

◆ set_stack_c_()

void set_stack_c_ ( int * stack)

Definition at line 40 of file stacksize_c.c.

40 {
41
42 const rlim_t kStackSize = -1L; // -1L = Unlimited
43 struct rlimit rl;
44 long int StMB;
45 int result;
46
47 result = getrlimit(RLIMIT_STACK, &rl);
48
49 if (rl.rlim_cur != -1){
50 /* Current Stacksize not unlimited */
51
52 /* Set the Stacksize to the Max possible value (best is unlimited : -1) */
53 if (rl.rlim_max != -1L){
54 rl.rlim_cur = rl.rlim_max;
55 }else{
56 rl.rlim_cur = kStackSize;
57 }
58
59 result = setrlimit(RLIMIT_STACK, &rl);
60
61 }
62 StMB = rl.rlim_cur / (1024*1024);
63 *stack = StMB;
64}

◆ set_stack_c__()

void set_stack_c__ ( int * stack)

Definition at line 73 of file stacksize_c.c.

73 {
74 set_stack_c_(stack);
75
76 }