02-21-2010
Let me get this straight: you have a custom memory management library, and your code using that library crashes?
OK.
You need all the help you can get. But there's not much out there.
Your only hope is to do something like download a demo copy of Purify and use it. And then pray that you don't have any bugs in your custom library.
And good luck.
You're going to need it.
There's a reason why nobody writes their own memory management libraries. First off, the multiple libraries available for free on your OS of choice are almost certainly fast enough. If they're not, you're most likely doing something wrong, like an over-reliance on malloc()/free() and/or new/delete. And if the OS libaries truly aren't fast enough (and if you're not multithreaded on a massively parallel application, they ARE fast enough!), there are third-party memory management libraries available.
Go price something like Smartheap. Then calculate all the hours spent on your custom memory library and how much those hours cost. Want to bet Smartheap is cheaper? If you even need it in the first place.
There are probably literally thousands of man-years invested by many absolutely brilliant computer scientists and programmers in all the memory-management libraries available in today's operating systems. And those products have been thoroughly tested - for literally decades.
You want a car analogy? Writing your own memory management library is like chiseling out a stone wheel for a sports car. The only reason to do it is for the sake of doing it - as a hobby or academic learning experience. Because there's no way you can duplicate the engineering history behind a "normal" wheel. Even if you do manage to chisel out a wheel that manages to outperform a "normal" wheel in a tiny operating range, you'll never really know how durable your wheel is because it's totally untested.
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
I'm trying to compile and install both most recent version of 'make' and the
most recent version of 'openssh' on my Sparc20.
I've run into the following problems... and I don't know what they mean. Can
someone please help me resolve these issues?
I'm using the 'make' version that was... (5 Replies)
Discussion started by: xyyz
5 Replies
2. UNIX for Dummies Questions & Answers
I renamed ld.so.1 on a Sun machine running Solaris 2.6. Now I cannot boot the system and I can use only very few commands in Maintenance Mode.
Can someone help me? (3 Replies)
Discussion started by: ciccio
3 Replies
3. Programming
does anyone knows how to accept a command from a user.. i was wondering to use fgets(), but got no idea how to start it... (4 Replies)
Discussion started by: skanky
4 Replies
4. Programming
Hello Friends,
I got stuck with fgets () & rewind() function .. Please need help..
Actually I am doing a like,
The function should read lines from a txt file until the function is called..
If the data from the txt file ends then it goes to the top and then again when the function is called... (1 Reply)
Discussion started by: user_prady
1 Replies
5. Programming
Assume client send the message " Hello ", i get output such as
Sent mesg: hello
Bytes Sent to Client: 6
bytes_received = recv(clientSockD, data, MAX_DATA, 0);
if(bytes_received)
{
send(clientSockD, data, bytes_received, 0);
data = '\0';... (2 Replies)
Discussion started by: f.ben.isaac
2 Replies
6. Programming
Hi all,
I have this method to read a string from a STDIN:
void readLine(char* inputBuffer){
fgets (inputBuffer, MAX_LINE, stdin);
fflush(stdin);
/* remove '\n' char from string */
if(strlen(inputBuffer) != 0)
inputBuffer = '\0';
}
All work fine but if i... (1 Reply)
Discussion started by: hurricane86
1 Replies
7. UNIX for Dummies Questions & Answers
Hello,
I am having problems with using less on
Linux version 2.6.18-92.1.17.el5 (brewbuilder@hs20-bc1-7.build.redhat.com) (gcc version 4.1.2 20071124 (Red Hat 4.1.2-42)). I am using csh but have the same problems on bash.
If I pipe something to less it works perfectly i.e. cat file | less... (9 Replies)
Discussion started by: z1dane
9 Replies
8. Programming
hello,
i'm trying to write a C-program that reads a file line by line.
(and searches each line for a given string)
This file is an special ASCII-database-file, with a lot of entries.
I checked the line with most length, and it was about 4000 characters.
With google i found several... (4 Replies)
Discussion started by: p1cm1n
4 Replies
9. Programming
Hi,
I have a string like this,
char str ="This, a sample string.\\nThis is the second line, \\n \\n, we will have one blank line";
if I want to use strtok() to seperate the string, which token should I use?
I tried "\n", "\\n", either not working.
peter (1 Reply)
Discussion started by: laopi
1 Replies
10. Shell Programming and Scripting
Any ideas how to clear this error as it seems I dont understand if,do,while and els commands
#!/bin/ksh
set -x
print "This script creates test messages"
print "Please enter test case name"
read testcasename
echo $testcasename
skipfield=Y
while
print "Do you want to skip this field... (4 Replies)
Discussion started by: andrew.p.mcderm
4 Replies
LEARN ABOUT DEBIAN
smlistsh
SMLISTSH(1) ICI executables SMLISTSH(1)
NAME
smlistsh - shared-memory linked list test shell
SYNOPSIS
smlistsh partition_size
DESCRIPTION
smlistsh attaches to a region of system memory (allocating it if necessary, and placing it under PSM management as necessary) and offers
the user an interactive "shell" for testing various shared-memory linked list management functions.
smlistsh prints a prompt string (": ") to stdout, accepts a command from stdin, executes the command (possibly printing a diagnostic
message), then prints another prompt string and so on.
The following commands are supported:
h The help command. Causes smlistsh to print a summary of available commands. Same effect as the ? command.
? Another help command. Causes smlistsh to print a summary of available commands. Same effect as the h command.
k The key command. Computes and prints an unused shared-memory key, for possible use in attaching to a shared-memory region.
+ key_value size
The attach command. Attaches smlistsh to a region of shared memory. key_value identifies an existing shared-memory region, in the
event that you want to attach to an existing shared-memory region (possibly created by another smlistsh process running on the same
computer). To create and attach to a new shared-memory region that other processes can attach to, use a key_value as returned by the
key command and supply the size of the new region. If you want to create and attach to a new shared-memory region that is for strictly
private use, use -1 as key and supply the size of the new region.
- The detach command. Detaches smlistsh from the region of shared memory it is currently using, but does not free any memory.
n The new command. Creates a new shared-memory list to operate on, within the currently attached shared-memory region. Prints the
address of the list.
s list_address
The share command. Selects an existing shared-memory list to operate on, within the currently attached shared-memory region.
a element_value
The append command. Appends a new list element, containing element_value, to the list on which smlistsh is currently operating.
p element_value
The prepend command. Prepends a new list element, containing element_value, to the list on which smlistsh is currently operating.
w The walk command. Prints the addresses and contents of all elements of the list on which smlistsh is currently operating.
f element_value
The find command. Finds the list element that contains element_value, within the list on which smlistsh is currently operating, and
prints the address of that list element.
d element_address
The delete command. Deletes the list element located at element_address.
r The report command. Prints a partition usage report, as per psm_report(3).
q The quit command. Detaches smlistsh from the region of shared memory it is currently using (without freeing any memory) and terminates
smlistsh.
EXIT STATUS
0 smlistsh has terminated.
FILES
No configuration files are needed.
ENVIRONMENT
No environment variables apply.
DIAGNOSTICS
No diagnostics apply.
BUGS
Report bugs to <ion-bugs@korgano.eecs.ohiou.edu>
SEE ALSO
smlist(3)
perl v5.14.2 2012-05-25 SMLISTSH(1)