02-26-2015
I assumed you had an allocator that you wanted to use. In fact, I assumed you had written an allocator that you wanted to use.
At any rate you have to have one in a shared library somewhere and my instructions show how to load it.
"I want to allocate some part of RAM to this process using C program" If that's what you want to do, what's wrong with the standard malloc?
Last edited by kbw; 02-26-2015 at 02:38 PM..
Reason: Add futher information
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I would like to know how I could allocate some more memory to a process.
Please note that I am not the root user. (1 Reply)
Discussion started by: sagar
1 Replies
2. UNIX for Advanced & Expert Users
Hello!
First of all, forgive me for bad English.
When I starts new thread (pthread_create), system allocates some memory for it (for example, for thread's stack). I wonder when does it deallocate this memory? The problem is that I have a program which sometimes creates new threads and sometimes... (3 Replies)
Discussion started by: prankster
3 Replies
3. UNIX for Dummies Questions & Answers
Hi all,
I have a HP-UX Server with 4 gigabytes of physical RAM. When I use the 'Glance' utility to see what my memory utilization is, my memory usage shows up maxed out at 99%. I shut off all the known processes that I'm running on that box and the memory utilization is still at 78% (with Swap... (1 Reply)
Discussion started by: dehuang83
1 Replies
4. HP-UX
Hi all,
I have a HP-UX Server with 4 gigabytes of physical RAM. When I use the 'Glance' utility to see what my memory utilization is, my memory usage shows up maxed out at 99%. I shut off all the known processes that I'm running on that box and the memory utilization is still at 78% (with Swap... (3 Replies)
Discussion started by: dehuang83
3 Replies
5. Programming
Hi everyone,
I'm not new to C programming, but I'm having question regarding the memory allocation of a pointer variable which, for instance, will be declared in main(), but its memory will be allocated in subroutine.
To clearify my question, I provide a small working example:
#include... (1 Reply)
Discussion started by: MIB_Maik
1 Replies
6. Programming
Hi Experts
I need some help in static memory allocation in C. I have a program in which I declared 2 variables, one char array and one integer. I was little surprised to see the addresses of the variables.
First:
int x;
char a;
printf("%u %u\n', &x, a);
I got the addresses displayed... (2 Replies)
Discussion started by: unx_freak
2 Replies
7. Shell Programming and Scripting
hello all..
i'm a beginner in shell scripting. I need to know what is really happening when we are creating a variable in shell scripting? how memory is allocated for that variable? (3 Replies)
Discussion started by: aarathy
3 Replies
8. HP-UX
Hi,
I have HP-UX 11i v3 running on ia64. One of my application is 32-bit and I want to increase the memory allocation of this file upto 2GB. I am contentiously receiving an error message of Out of Memory.
Can you please explain the procedure what kernel configuration( like maxdsize or... (1 Reply)
Discussion started by: ahmadamin416
1 Replies
9. Programming
Hello,
I am new to C++ programming, so I'm still getting a feel for things. I recently wrote a simple C++ program (to be used as a ROOT Macro) to conduct a statistical analysis of a varied version of the Monty Hall problem (code below). Basically, the programs runs a few simple calculations to... (7 Replies)
Discussion started by: Tyler_92
7 Replies
10. UNIX for Dummies Questions & Answers
I am using ubuntu. I have written a program to calculate prime factors. it works perfectly fine till entered number is less than 9989 (or so ) but when one enters a number higher than that, for example 15000, it does not work. Can anyone guide me whats the problem ? although new codes are welcome,... (2 Replies)
Discussion started by: Abhishek_kumar
2 Replies
LEARN ABOUT FREEBSD
new_unrhdr
UNR(9) BSD Kernel Developer's Manual UNR(9)
NAME
new_unrhdr, delete_unrhdr, alloc_unr, alloc_unr_specific, free_unr -- kernel unit number allocator
SYNOPSIS
#include <sys/systm.h>
struct unrhdr *
new_unrhdr(int low, int high, struct mtx *mutex);
void
delete_unrhdr(struct unrhdr *uh);
int
alloc_unr(struct unrhdr *uh);
int
alloc_unrl(struct unrhdr *uh);
int
alloc_unr_specific(struct unrhdr *uh, u_int item);
void
free_unr(struct unrhdr *uh, u_int item);
DESCRIPTION
The kernel unit number allocator is a generic facility, which allows to allocate unit numbers within a specified range.
new_unrhdr(low, high, mutex)
Initialize a new unit number allocator entity. The low and high arguments specify minimum and maximum number of unit numbers. There
is no cost associated with the range of unit numbers, so unless the resource really is finite, INT_MAX can be used. If mutex is not
NULL, it is used for locking when allocating and freeing units. Otherwise, internal mutex is used.
delete_unrhdr(uh)
Destroy specified unit number allocator entity.
alloc_unr(uh)
Return a new unit number. The lowest free number is always allocated. This function does not allocate memory and never sleeps, how-
ever it may block on a mutex. If no free unit numbers are left, -1 is returned.
alloc_unrl(uh)
Same as alloc_unr() except that mutex is assumed to be already locked and thus is not used.
alloc_unr_specific(uh, item)
Allocate a specific unit number. This function allocates memory and thus may sleep. The allocated unit number is returned on suc-
cess. If the specified number is already allocated or out of the range, -1 is returned.
free_unr(uh, item)
Free a previously allocated unit number. This function may require allocating memory, and thus it can sleep. There is no pre-locked
variant.
CODE REFERENCES
The above functions are implemented in sys/kern/subr_unit.c.
HISTORY
Kernel unit number allocator first appeared in FreeBSD 6.0.
AUTHORS
Kernel unit number allocator was written by Poul-Henning Kamp. This manpage was written by Gleb Smirnoff.
BSD
July 5, 2010 BSD