08-21-2008
Despite what everyone said I think speed differences between both cases are not mensurable. For one, memory is stored in the data segment in both cases thus it's accessed in the same way/speed. Furthermore, this is highly platform/architecture/implementation dependent.
We should call a meta-programmer to enlighten us with accurate specifications on the matter at hand.
8 More Discussions You Might Find Interesting
1. Programming
Hi all
My question is related to following sample code which tries to change consant value by pointers.(I know it is wrong practice but i am surprised by mis-behaviour)
The code:
#include <stdio.h>
int main()
{
const int x = 10;
int *y;
const int * const z = &x;
y = (int *)&x;... (2 Replies)
Discussion started by: Shobhit
2 Replies
2. Shell Programming and Scripting
is it possible to use eval to create constants in perl? i cannot seem to get anything to work, and my searches are turning up little to nothing. an example of what i am trying to do is this:
2 arrays:
array 1: 'FOOD','NUMBER','OS'
array 2: 'pizza','two','unix'
loop through the arrays and... (5 Replies)
Discussion started by: effigy
5 Replies
3. Shell Programming and Scripting
currently it has the following:
bdumpN=`ll /home/apps/oracle/admin/DBprod/bdump/DBprod_j* | grep "$Cdate" | wc -l`
If I pass the DBname, I would not have to hardcode it in the script...
I can capture the database name by adding the following:
DBname=$1
The problem is, I have been unable... (2 Replies)
Discussion started by: mr_manny
2 Replies
4. UNIX for Dummies Questions & Answers
Hi
Can any one help me out ?
I am trying to send an autogenerated mail with an attachment to bulk of users using 'MAILX' and 'UNENCODE' . I have used it as follows
X " ( cat /sastemp/body.txt; uuencode Test.xls.gz Test.xls.gz ) | mailx -s 'Testing' ' abcd@yahoo.com , efgh@gmail.com ' "
... (9 Replies)
Discussion started by: manas6
9 Replies
5. UNIX for Dummies Questions & Answers
Hello there,
I'd like to define a variable b equal to 0.5/a where a=0.001, so I wrote something like that:
a=0.001;
let 'b=0.5/$a';
but it doesn't work... maybe because the variable a has a real value???
Any help will be appreciated!!!:D (1 Reply)
Discussion started by: Giordano Bruno
1 Replies
6. Programming
Hello,
I'm trying to write a method which will return the extension of a file given the file's name, e.g. test.txt should return txt. I'm using C so am limited to char pointers and arrays. Here is the code as I have it:
char* getext(char *file)
{
char *extension;
int i, j;... (5 Replies)
Discussion started by: pallak7
5 Replies
7. Programming
Compiling xpp (The X Printing Panel) on SL6 (RHEL6 essentially):
xpp.cxx: In constructor ‘printFiles::printFiles(int, char**, int&)’:
xpp.cxx:200: error: invalid conversion from ‘const char*’ to ‘char*’
The same error with all c++ constructors - gcc 4.4.4.
If anyone can throw any light on... (8 Replies)
Discussion started by: GSO
8 Replies
8. Web Development
Hi,
I would like to read content from a https site.
I have decided to use LWP module in perl. but it throwed 401 Authorization required error.
i dont want to hard code the password in my perl code. Is there any way to achieve the authentication without hardcoding the password.
Thanks,... (1 Reply)
Discussion started by: pandeesh
1 Replies
plimit(1) User Commands plimit(1)
NAME
plimit - get or set the resource limits of running processes
SYNOPSIS
plimit [-km] pid...
plimit {-cdfnstv} soft,hard... pid...
DESCRIPTION
If one or more of the cdfnstv options is specified, plimit sets the soft (current) limit and/or the hard (maximum) limit of the indicated
resource(s) in the processes identified by the process-ID list, pid. Otherwise plimit reports the resource limits of the processes identi-
fied by the process-ID list, pid.
Only the owner of a process or the super-user is permitted either to get or to set the resource limits of a process. Only the super-user
can increase the hard limit.
OPTIONS
The following options are supported:
-k On output, show file sizes in kilobytes (1024 bytes) rather than in 512-byte blocks.
-m On output, show file and memory sizes in megabytes (1024*1024 bytes).
The remainder of the options are used to change specified resource limits. They each accept an argument of the form:
soft,hard
where soft specifies the soft (current) limit and hard specifies the hard (maximum) limit. If the hard limit is not specified, the comma
may be omitted. If the soft limit is an empty string, only the hard limit is set. Each limit is either the literal string unlimited, or a
number, with an optional scaling factor, as follows:
nk n kilobytes
nm n megabytes (minutes for CPU time)
nh n hours (for CPU time only)
mm:ss minutes and seconds (for CPU time only)
The soft limit cannot exceed the hard limit.
-c soft,hard Set core file size limits (default unit is 512-byte blocks).
-d soft,hard Set data segment (heap) size limits (default unit is kilobytes).
-f soft,hard Set file size limits (default unit is 512-byte blocks).
-n soft,hard Set file descriptor limits (no default unit).
-s soft,hard Set stack segment size limits (default unit is kilobytes).
-t soft,hard Set CPU time limits (default unit is seconds).
-v soft,hard Set virtual memory size limits (default unit is kilobytes).
OPERANDS
The following operands are supported.
pid Process ID list.
EXIT STATUS
plimit returns the exit value zero on success, non-zero on failure (such as no such process, permission denied, or invalid option).
FILES
/proc/pid/* process information and control files
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWesu |
+-----------------------------+-----------------------------+
SEE ALSO
ulimit(1), proc(1), getrlimit(2), setrlimit(2), proc(4), attributes(5),
SunOS 5.10 8 Jun 1998 plimit(1)