Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pike
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pikelang
pike
Commits
580981cf
Commit
580981cf
authored
Mar 25, 2006
by
Henrik (Grubba) Grubbström
Browse files
Options
Downloads
Patches
Plain Diff
Added Pike.get_runtime_info().
Rev: lib/modules/Pike.pmod/module.pmod:1.13 Rev: src/builtin.cmod:1.184
parent
9d618808
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/modules/Pike.pmod/module.pmod
+3
-1
3 additions, 1 deletion
lib/modules/Pike.pmod/module.pmod
src/builtin.cmod
+64
-1
64 additions, 1 deletion
src/builtin.cmod
with
67 additions
and
2 deletions
lib/modules/Pike.pmod/module.pmod
+
3
−
1
View file @
580981cf
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
// Pike core things that don't belong anywhere else.
// Pike core things that don't belong anywhere else.
//
//
// $Id: module.pmod,v 1.1
2
200
4/10/30 11:39:21 mast
Exp $
// $Id: module.pmod,v 1.1
3
200
6/03/25 20:43:20 grubba
Exp $
constant WEAK_INDICES = __builtin.PIKE_WEAK_INDICES;
constant WEAK_INDICES = __builtin.PIKE_WEAK_INDICES;
constant WEAK_VALUES = __builtin.PIKE_WEAK_VALUES;
constant WEAK_VALUES = __builtin.PIKE_WEAK_VALUES;
...
@@ -40,6 +40,8 @@ constant DefaultBackend = __builtin.__backend;
...
@@ -40,6 +40,8 @@ constant DefaultBackend = __builtin.__backend;
constant gc_parameters = __builtin.gc_parameters;
constant gc_parameters = __builtin.gc_parameters;
constant get_runtime_info = __builtin.get_runtime_info;
program Encoder = [program] master()->Encoder;
program Encoder = [program] master()->Encoder;
program Decoder = [program] master()->Decoder;
program Decoder = [program] master()->Decoder;
program Codec = [program] master()->Codec;
program Codec = [program] master()->Codec;
This diff is collapsed.
Click to expand it.
src/builtin.cmod
+
64
−
1
View file @
580981cf
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
|| This file is part of Pike. For copyright information see COPYRIGHT.
|| This file is part of Pike. For copyright information see COPYRIGHT.
|| Pike is distributed under GPL, LGPL and MPL. See the file COPYING
|| Pike is distributed under GPL, LGPL and MPL. See the file COPYING
|| for more information.
|| for more information.
|| $Id: builtin.cmod,v 1.18
3
2006/03/2
2
20:
0
0:
10
grubba Exp $
|| $Id: builtin.cmod,v 1.18
4
2006/03/2
5
20:
4
0:
52
grubba Exp $
*/
*/
#include
"global.h"
#include
"global.h"
...
@@ -1492,6 +1492,69 @@ PIKECLASS backtrace_frame
...
@@ -1492,6 +1492,69 @@ PIKECLASS backtrace_frame
/*! @endclass
/*! @endclass
*/
*/
/*! @decl mapping(string:int|string) get_runtime_info()
*!
*! Get information about the Pike runtime.
*!
*! @returns
*! Returns a mapping with the following content:
*! @mapping
*! @member string "bytecode_method"
*! A string describing the bytecode method used by
*! the Pike interpreter.
*! @member int "abi"
*! The number of bits in the ABI. Usually @expr{32@} or @expr{64@}.
*! @member int "native_byteorder"
*! The byte order used by the native cpu.
*! Usually @expr{1234@} (aka little endian) or @{4321@} (aka bigendian).
*! @member int "int_size"
*! The number of bits in the native integer type.
*! Usually @expr{32@} or @expr{64@}.
*! @member int "float_size"
*! The number of bits in the native floating point type.
*! Usually @expr{32@} or @expr{64@}.
*! @member int(0..1) "auto_bignum"
*! Present if integers larger than the native size are automatically
*! converted into bignums.
*! @endmapping
*/
PIKEFUN
mapping
(
string
:
int
|
string
)
get_runtime_info
()
optflags
OPT_TRY_OPTIMIZE
;
{
pop_n_elems
(
args
);
push_constant_text
(
"bytecode_method"
);
push_constant_text
(
#if PIKE_BYTECODE_METHOD == PIKE_BYTECODE_IA32
"ia32"
#elif PIKE_BYTECODE_METHOD == PIKE_BYTECODE_SPARC
"sparc"
#elif PIKE_BYTECODE_METHOD == PIKE_BYTECODE_PPC32
"ppc32"
#elif PIKE_BYTECODE_METHOD == PIKE_BYTECODE_GOTO
"computed_goto"
#elif PIKE_BYTECODE_METHOD == PIKE_BYTECODE_DEFAULT
"default"
#else
"unknown"
#endif
);
push_constant_text
(
"abi"
);
push_int
(
sizeof
(
void
*
)
*
8
);
push_constant_text
(
"native_byteorder"
);
push_int
(
PIKE_BYTEORDER
);
push_constant_text
(
"int_size"
);
push_int
(
sizeof
(
INT_TYPE
)
*
8
);
push_constant_text
(
"float_size"
);
push_int
(
sizeof
(
FLOAT_TYPE
)
*
8
);
#ifdef AUTO_BIGNUM
push_constant_text
(
"auto_bignum"
);
push_int
(
1
);
f_aggregate_mapping
(
6
*
2
);
#else
f_aggregate_mapping
(
5
*
2
);
#endif
}
/*! @endmodule
/*! @endmodule
*/
*/
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment