@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2



Comments:

<0> bla
<0> bye
<1> n
<2> Without further ado let me ask
<2> in struct this I have
<2> struct node **lower; /* Table with pointers to child nodes */
<2> and on
<2> this->lower=realloc(this->lower, (this->chld_id)*sizeof(struct node *));
<2> compiler returns
<2> tree.c:76: warning: ***ignment makes pointer from integer without a cast
<2> which is totally nonsense
<2> ah ok
<2> it was the header file problem
<2> fixed
<2> ;>
<3> I_v0: you know that realloc can be very expensive?



<2> cehteh I've got problem with realloc now :/
<3> whats it?
<2> (gdb) print this->lower
<2> $4 = (struct node **) 0x804a088
<2> (gdb) print this->chld_id
<2> $5 = 4
<2> (gdb) print sizeof(struct node *)
<2> $6 = 4
<2> and when doing
<2> 78 this->lower=realloc(this->lower, (this->chld_id)*sizeof(struct node *));
<3> eh
<2> *** glibc detected *** realloc(): invalid next size: 0x0804a088 ***
<2> what?
<3> dont paste here that much and forget gdb
<2> what then?
<2> if no gdb
<2> (I pasted becouse noone seems to be here now :)
<3> use your brain :)
<2> nahhh
<2> :P
<2> it's not that easy :P
<3> valgrind
<3> and wtf do you try 0x0804a088 is how big?
<2> cehteh it's a pointer
<2> look here
<2> http://rafb.net/paste/results/yYYFbi25.html
<2> error occurs in line 78
<2> this... is a bit complex
<2> :P
<3> and ugly
<2> I made what is my best
<3> and you dont check malloc or realloc's returns
<3> his->lower=realloc(this->lower, (this->chld_id)*sizeof(struct node *));
<2> yeah, I'll add sec_realloc/malloc later
<3> if (!this->lower) abort();
<3> just do that at least
<2> ok
<2> but this won't fix my problem :(
<3> and i dont get the point of your program what shall it do and why do you need such a big block of memory
<2> hmmm? big?
<3> 128mb
<3> next realloc might/will move your data
<2> it is constructing a binary tree, the unusal one becouse I don't have left and right, insted I've got the lower table in which are pointers to structure, so one member can have 3, 4, 7, 100 childs
<2> cehteh move?
<3> if you have pointers referencing something in that block, then you are doomed
<2> uh... didn't thought about it
<3> ok .. delete, rinse, repeat :)
<2> ok I'll consider this
<2> cehteh you mean it's possible that this is the case of my problem?
<2> well it is a problem, but if it's that
<3> likely .. i am tired and didnt looked closely at your source
<2> ok, I'll fix it, way or another I need to do it
<3> and if you point to tables, then its not anymore a binary tree ;)
<3> why do you try this all-so-clever optimization to store tables?
<2> optimization?
<2> I just can't know if there'll be 100 child's or 1 child
<3> well i dont get the intention behind your program
<3> ah and you store a FILE* in the node .. how much nodes will you have?
<3> considered that file handles are limited?
<2> don't know, I'll crawl through the web
<3> there are systems where you can open at most 7 files at one time out there ..



<3> ok not the systems you work on prolly but still
<2> open one page, find links, and make childs which will point to this links, download these pages save to files, open each of them and again all links...
<3> why dont you use some existing crawler for that?
<2> cehteh mhm, so it's obviously better to store a url than a file *
<2> cehteh I wan't to play with this tree
<3> well then have fun
<3> instead using an array you can use a linked list
<2> when being consequent I only do the tree, other guy makes a crawler and all ****
<3> heh
<2> and I'll use this tree in my other program
<2> after it'll work
<2> ;>
<2> ok I'll consider using linked list
<3> doesnt look very useable yet
<2> hehe :P
<2> it's on a work bench!
<2> :>
<3> and try to minimize the use of malloc and free
<3> (and reallco)
<2> ok
<3> will that become part of a free-software project?
<2> what do you mean ? if it'll be on a GPL license? -yes
<3> yes exactly thats what i meant :)
<2> yeah, you have even my blessing on using it after it'll work
<2> ;-)
<2> garbage collector?
<3> http://www.pipapo.org/pipawiki/Acogc
<3> you can use it to allocate things and dont need to care for freeing
<2> wtf is going on, someones knocking at my doors
<2> hardly, and it's 06:14 am here :/
<3> here too :P
<3> germany here
<3> maybe the bad-hacker-police? :)
<2> nahhh, some stupid tourists couldn't find the toilet which was right in front of them
<2> with the big mark on the dors "Toaleta" which means toilet
<2> hmmm inserting there a linked list will be... acrobatic
<3> i dont think so
<2> hmmm? I thought you told about inserting a pointer to linked list in place of lower
<3> actualy your node will become smaller
<3> you you have 2 lists one of things_to_be_scanned and one of already_scanned
<3> anyways i am going to bed good night
<2> ok thanks for advice
<2> good night ;-)
<2> at least now I have segmentation fault error which I understand why occurs, and not as previously some realloc error
<2> how to trace when is called this->searched in gdb ?
<4> break before the call, then step.
<2> hmmm, I rather thought about more complex solution, becouse I call this->searched many times in program
<2> and wan't to see how it changes
<4> then break before the call, look at the value, then continue.
<2> hmmm ok
<5> witam
<5> hello
<0> grrrrr... is there some option to produce in map file the size taken up by individual functions?
<0> I really don't want to split up into 1000 .o just to get a good overview :)
<0> (gcc/ld)
<6> nm -S?
<0> thx! :)
<0> oh, there's even --size-sort, neat
<0> is there some tool that can report max stack use for some source file(s) ?
<0> if I don't use external libs
<0> ...and which will report "cannot be calculated" if unknown
<7> depends on compiler probably
<0> gcc
<0> ah, like that
<0> yeah
<0> hmm
<0> it can't be actually known by anyone/-thing _but_the compiler
<0> s/_t/_ t/
<0> if I initialize variables like this: void foo( void ) { char a = getchar(); char b = getchar(); ... } are they supposed to be initialized (read) in that order?
<0> not important, too lazy to read specs, just wondering
<7> michai: that's not ANSI C89
<0> ok
<0> laters


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #c
or
Go to some related logs:

#html
Gnammy
#sicilia
#worldchat
#worldchat
#worldchat
#worldchat
#worldchat
#worldchat
#worldchat



Home  |  disclaimer  |  contact  |  submit quotes