Berkeley CSUA MOTD:Entry 20713
Berkeley CSUA MOTD
 
WIKI | FAQ | Tech FAQ
http://csua.com/feed/
2025/05/24 [General] UID:1000 Activity:popular
5/24    

2001/2/27 [Computer/HW/Memory, Computer/SW/Languages/C_Cplusplus] UID:20713 Activity:high
2/26    Hey folks, I'm looking for something like Purify but cheap.
        What do people do for C programming to guard against memory
        bashing and leaks, other than write their own malloc and
        buy expensive software from Rational?
        \_ wasn't there some kind of program to analyze C code for
           no no's. I think it was called something like lint.
              \_ uh, lint is a syntax checker. it does not figure
                 out if your code has memory leaks.
           \_ memory bashing.  memory leaks.
              \- wasnt there something called electric fence or something
              like that? --psb
                \_ Yes.  -lefence on some Linux systems, or you can go
                   and get the library.  However, efence just puts illegal
                   pages before and after every memory allocation.  This
                   means that if you write outside of the bounds of any
                   allocation, it seg faults immediately there, showing
                   you the memory error immediately if you're using a debugger.
                   This is VERY demanding of memory however, and slow.
                   Memory use will 10x, speed will .04x.  efence is in NO way
                   as good as purify....  --PeterM
2025/05/24 [General] UID:1000 Activity:popular
5/24    

You may also be interested in these entries...
2012/12/18-2013/1/24 [Computer/SW/Languages/Perl] UID:54561 Activity:nil
12/18   Happy 25th birthday Perl, and FUCK YOU Larry Wall for fucking up
        the computer science formalism that sets back compilers development
        back for at least a decade:
        http://techcrunch.com/2012/12/18/print-happy-25th-birthday-perl
        \_ I tried to learn Perl but was scared away by it.  Maybe scripting
           lanauages have to be like that in order to work well?
	...
2012/2/5-3/26 [Computer/SW/WWW/Browsers] UID:54300 Activity:nil
2/5     How is Firefox on version 10, while I still have 3.6 installed.
        I wait for the X.1 versions and they never come out.
        \_ I'm also on 3.6.26.  It claims that versions 4 - 10 are all faster
           than 3.6.x, but do they use more memory?  Thx.
           \_ Newer Firefox versions use less memory too:
              http://www.maximumpc.com/article/news/mozillas_memshrink_program_brings_big_memory_savings_firefox_7
	...
2011/6/5-8/27 [Computer/HW/Memory] UID:54127 Activity:nil
6/5     In an effort to stabilize our services, we'll be rebuilding parts of
        the CSUA infrastructure over the course of this summer.  To give us
        some wiggle room, I've temporarily decreased soda's allocated RAM from
        8GB to 2GB.  If you need to run something that requires large amounts
        of memory, please send mail to root@csua.org and we'll try to
        accommodate your request.  --jordan
	...
2011/3/26-4/20 [Computer/HW/Memory] UID:54062 Activity:nil
3/19    When you're explaining the stack to people do you draw it with the
        highest addresses at the top or at the bottom?
        \_ When I explain any memory layout including stacks, I draw with the
           highest addresses at the bottom.  But I've seen people doing the
           other way.  -- yuen
           \_ do you by any chance have seen or have a jpg of the full memory
	...
2010/7/25-8/25 [Computer/SW/Graphics] UID:53897 Activity:nil
7/25    What's up with that moving bit pattern that Win7 displays when it
        boots up?  (It's the one that's like in the Apple II days when you
        use the graphics memory for code or data while it's still in HGR
        mode.)  Is there a way to disable that?  It slows things down a lot
        every time I reboot my Win7 VM on my office machine if I RDP to the
        machine via DSL.  Thanks in advance.
	...
2010/5/26-6/30 [Computer/SW/Unix/WindowManager, Computer/SW/OS/OsX] UID:53844 Activity:nil
5/26    anyone use lxde?  supposedly it is less stupid than xfce and
        less bloated than gnome.  thoughts?
        \_ lol, does anyone still use desktop linux?  Get with the times
           buy a mac.  Now.  DO IT.  Go NOW.
           \_ but we prefer herring to Kool-Aid
              \_ "you have to yell, he's hard of herring"
	...
2010/6/4-30 [Computer/SW/Languages/C_Cplusplus] UID:53849 Activity:nil
6/4     Is this valid C++ code?
        std::string getStr(void) {
            std::string str("foo");
            return str;
        }
        void foo(char *s);
	...
2009/12/7-2010/1/3 [Computer/HW/Memory, Computer/HW] UID:53574 Activity:nil
12/7    How many TCP retransmits are too many? Here is what I get:
            3594143433 segments received
            3760174421 segments send out
            3801829561 segments retransmited
        \_ rephrase. you can never have too much money. or too little.
           what is, is.
	...
2009/10/27-11/3 [Computer/HW/Drives] UID:53474 Activity:nil
10/27   I just read an article that Facebook had moved their database
        to all SSD to speed throughput, but now I can't find it. Has
        anyone else seen this? Any experience with doing this? -ausman
        \_ I hope you're not running mission critical data:
           http://ask.slashdot.org/story/09/10/27/1559248/Reliability-of-PC-Flash-SSDs?from=rss
        \_ Do you have any idea how much storage space is used by Facebook,
	...
2009/7/21-24 [Computer/SW/Languages/Java] UID:53168 Activity:moderate
7/20    For those who care btw, it looks like eclipse is now A Standard Tool
        at UCB ugrad cs, probably replaced emacs.  Furthermore, people get
        angry at seeing Makefiles, (since eclispe takes care of that).  I
        guess it's just a sign of the times.
        \_ The more people at my work use eclipse the less the code is
           managable in emacs.  I'm not sure which application's fault
	...
2014/1/14-2/5 [Computer/SW/Languages/C_Cplusplus] UID:54763 Activity:nil
1/14    Why is NULL defined to be "0" in C++ instead of "((void *) 0)" like in
        C?  I have some overloaded functtions where one takes an integer
        parameter and the other a pointer parameter.  When I call it with
        "NULL", the compiler matches it with the integer version instead of
        the pointer version which is a problem.  Other funny effect is that
        sizeof(NULL) is different from sizeof(myPtr).  Thanks.
	...
2011/3/7-4/20 [Computer/SW/Languages/C_Cplusplus] UID:54056 Activity:nil
3/7     I have a C question.  I have the following source code in two identical
        files t.c and t.cpp:
                #include <stdlib.h>
                int main(int argc, char *argv[]) {
                  const char * const * p1;
                  const char * * p2;
	...
2005/2/15-16 [Computer/SW/Languages/C_Cplusplus, Computer/SW/Compilers] UID:36174 Activity:moderate
2/15    Technical question:  we have a memory leak in our C code, we think,
        but it's not the sort of memory leak where the memory's unreferenced.
        What we'd like to do is sort of a poor-man's profile, we want
        to know who calls our memory allocator "New"...  Sorta like a stack
        trace.  Using an actual profiler is sort of difficult 'cause it's
        a parallel application.  Thanks,  --peterm
	...
2004/9/23 [Computer/SW/Languages/C_Cplusplus] UID:33716 Activity:high
9/23    Is the a C++ equivelent to the C realloc function?
        \_ realloc(). But seriously, maybe you want an STL container
           that automatically grows.
           \_ Not in this case.  I just need to grow a char array
              automatically myself.   (For speed reasons) Really, It's a
              very isolated place in the code, and I'll probably just end
	...
2004/8/10-11 [Computer/SW/Languages/C_Cplusplus, Computer/SW/Compilers] UID:32805 Activity:high
8/10    C question.  Is there anything wrong with the following?
        const my_struct_t **pp;
        pp = malloc(sizeof(my_struct_t *));
        pp = realloc(pp, sizeof (my_struct_t *) * 2);
        "gcc -Wall" doesn't complain.  But the M$ compiler (cl.exe) complains
        about the realloc line:
	...
2004/4/13-14 [Computer/SW/Languages/C_Cplusplus] UID:13175 Activity:high
4/13    How much C++/C knowledge do recent Berkeley CS/EECS grad have?
        \_ Class CSGrad inherits FromDaddy and does not implement C++Knowledge
           very well.
           \_ funny.  just the rich and poor as always.  the middle class can't
              afford education.
        \_ They know how to deal with pointers and addresses, malloc and free.
	...
2003/12/4-5 [Computer/SW/Languages/C_Cplusplus] UID:11317 Activity:nil
12/4    Is there any reason to worry about mixing the usage of malloc and new?
        Obviously, you can't delete() malloc'd memory (and vv), but aside from
        that, will bad things happen?  Oh, I should note that this is for a C
        library that is used by C++ -- a coworker suggested wrapping my memory
        allocations (and deletions) with
        #ifdef __cplusplus
	...
2003/1/18-19 [Computer/SW/Languages/C_Cplusplus] UID:27139 Activity:very high
1/17    If I have "foo_bar_baz_struct_t *p, *q;", which of the following
        is better?
        1.      p = malloc(sizeof (foo_bar_baz_struct_t));
                memcpy(q, p, sizeof (foo_bar_baz_struct_t));
        2.      p = malloc(sizeof *p);
                memcpy(q, p, sizeof *p);
	...
2001/1/25-26 [Computer/SW/Languages/C_Cplusplus] UID:20431 Activity:high
1/25    C question.  I want to declare a variable p which stores the pointer to
        a malloc'ed array of 65536 elements.  Each of these 65536 elements
        in turn stores the pointer to a malloc'ed array or 16 int's.  What's
        the best way to declare p to include as much type information as
        possible?  Sure I can do "int ***p;", but that doesn't contain much
        type information.  Thanks.
	...
2000/2/11-13 [Computer/SW/Languages/C_Cplusplus] UID:17485 Activity:very high
2/10    I get an impression that new grads coming out of berkeley don't
        have much exposure to C.  I mean pure C, not C++.  How do most
        people feel about this?  I guess I'm asking alumni who are hiring
        and also current students.
        \_ I've spent the last year doing project in only C or Java, no C++.
        \_ they don't necessarily have much exposure to C++ either...
	...
1999/8/18-20 [Computer/SW/Languages/C_Cplusplus, Computer/SW/Compilers] UID:16336 Activity:nil
8/19    C question: I rarely, if ever, remember to include stdlib.h, which
        includes malloc, atoi, etc. But I use these functions on a regular
        basis. I haven't encountered a problem until I tried using atof(...)
        also in stdlib.h. Once I included stdlib.h, my problems went away.
        So why didn't I have problems with the other functions?
        \_ your compiler was assuming that undefined functions returned an int.
	...