Search:

Type: Posts; User: allynm; Keyword(s):

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. Replies
    37
    Views
    1,886

    Re: controlling malloc allocation size

    Good morning, trent.josephsen

    Wanted to let you know that I am about one-third of the way thru your tutorial. It is highly informative. Until very recently (within the last year) I had paid no...
  2. Replies
    0
    Views
    346

    dr memory -- can't make it run

    Hi everyone,

    I have been playing around with Valgrind, and as many of you know, it works pretty well. Got interested in alternatives and discovered quickly Dr. Memory.


    ...
  3. Replies
    37
    Views
    1,886

    Re: controlling malloc allocation size

    Good morning, trent.josephsen,

    I realized suddenly that mmap and malloc do very different things. I think I understand what malloc does, at least in principle, but I certainly don't understand...
  4. Replies
    37
    Views
    1,886

    Re: controlling malloc allocation size

    Good morning trent.josephson,

    I had read the section on M_CHECK_ACTION a number of times. What I discovered is that it will notify if you call free() more than once, but not if you overwrite a...
  5. Replies
    37
    Views
    1,886

    Re: controlling malloc allocation size

    Hi MG&TL.

    Here is the relevant secton of man btk:



    brk(0) [somewhat misleadingly] gives the current program break.

    If you look at the two calls to brk you will see that they are exactly...
  6. Replies
    37
    Views
    1,886

    Re: controlling malloc allocation size

    Hi MG&TL

    Somehow the printout from strace was duplicated in my prior response. You may disreegard everything that follows the first reference to exit_group(0). Sorry.

    Mark Allyn
  7. Replies
    37
    Views
    1,886

    Re: controlling malloc allocation size

    Hi MG&TL,

    OK, good idea. Here's a copy of strace ./nualloc 1 output:

    mark@mark-HP-ProBook-4525s:~/asm$ strace ./nualloc 1
    execve("./nualloc", ["./nualloc", "1"], [/* 38 vars */]) = 0
    brk(0) ...
  8. Replies
    37
    Views
    1,886

    Re: controlling malloc allocation size

    hello trent.josephson,

    OK, here is a little proggy that sets TOP_PAD to zero. The malloc stats call gives a brief display of what's mapped. You invoke the thing on the command line with...
  9. Replies
    37
    Views
    1,886

    Re: controlling malloc allocation size

    good morning, trent.josephson,

    Read your reply. I must run off to the cardiologist at the moment. Will return in an hour or so. I want to test your M_TOP_PAD suggestion. Interesting that so...
  10. Replies
    37
    Views
    1,886

    Re: controlling malloc allocation size

    Hi trent.josephson (and others),

    Well, after spending a stupidly large amount of time--I finally admit it--yesterday I discovered what, I think, is going on and how to control the malloc'd size. ...
  11. Replies
    37
    Views
    1,886

    Re: controlling malloc allocation size

    Good morning, MG&TL,

    Good idea. Thanks for the link. I couldn't get hold of my copy of K&R--it's buried under hay in my barn.

    Mark
  12. Replies
    37
    Views
    1,886

    Re: controlling malloc allocation size

    good morning trent.josephson and Bachsteize,

    That is a highly interersting conjecture. How can it be tested? Why would the kernel allocate unused space (besides that for the process image)?
    ...
  13. Replies
    37
    Views
    1,886

    Re: controlling malloc allocation size

    hi dwhitney67,

    I have time on my hands to investigate these oddities. When I find the answers I invariably feel better.

    One of the related functions to mallinfo() is mallopt(). I can't seem...
  14. Replies
    37
    Views
    1,886

    Re: controlling malloc allocation size

    Hi dwhitney67,

    I've spent quite a few hours now trying to find out what the heck is meant by "allocated but not used" and haven't had any luck. It is possible to get rid of some or nearly all of...
  15. Replies
    37
    Views
    1,886

    Re: controlling malloc allocation size

    dwhitney67,

    I got it by calling mallinfo(). This returns a mallinfo struct. The struct member named fordblks supposedly reports the number of unused but allocated bytes.

    Mark
  16. Replies
    37
    Views
    1,886

    Re: controlling malloc allocation size

    good morning, dwihitney67,

    I got it by running mallinfo() (defined malloc.h) to get a copy of the mallinfo struct. There is a member in this struct called mallifo.fordblks that contains the...
  17. Replies
    37
    Views
    1,886

    Re: controlling malloc allocation size

    Good morning, trent.josephson,

    After a call to malloc, a new membory break is established at the end of the "used" and "unused" allocated blocks, as I expect you know. The only way I know to...
  18. Replies
    37
    Views
    1,886

    Re: controlling malloc allocation size

    Hi dwhitney67,

    Thanks for the very nice demo. I haven't run it yet, but I will. With a debugger as well.

    Perhaps you can clarify a point that I find confusing about malloc(). When called it...
  19. Replies
    37
    Views
    1,886

    Re: controlling malloc allocation size

    Hi Dazman19,

    I have no idea why I gave you the name "Jaunty". Sorry to call you by a ubuntu version name....

    Mark
  20. Replies
    37
    Views
    1,886

    Re: controlling malloc allocation size

    Hi Jaunty,

    I take your point that the system is managing the unused bytes and there is no particular reason to concern oneself with what is done with them. However, if for some reason you write...
  21. Replies
    37
    Views
    1,886

    controlling malloc allocation size

    Hello everyone,

    Is there a technique for controlling the actual allocation size from the heap using malloc()? I find that if I allocate a block of nominal size n bytes by calling malloc(n), the...
  22. [SOLVED] Re: How to print to a Windows XP networked printer

    Ok, so by messing around for another couple of hours I finally got the connection to the networked printer to function as desired. Once again, I'm printing from a ubuntu 12.04 box to a Windows XP...
  23. [SOLVED] Re: How to print to a Windows XP networked printer

    Seiji and Hylm,

    As nearly as I can tell from the tute that Hylm sent, I should be trying to use Samba since I am on a ubuntu box trying to print from a windows networked machine. That is the gist...
  24. [SOLVED] How to print to a Windows XP networked printer

    Hello everyone,

    I have a very small networked printer (HP1505 laserjet). It exists on a wireless network consisting of two XP boxes and 1 windows 7 box. The network works fine as such. I'd like...
  25. Replies
    1
    Views
    318

    using as command to assemble a PIC object

    Hello everyone,

    I decided to learn more about shared objects, the dynamic linker, etc. My question pertains to Postition Independent Code creation using the as (GAS) command. There is no command...
Results 1 to 25 of 66
Page 1 of 3 1 2 3