Re: nlffi memory problems on power ppc

brian <briand-/[email protected]> Mon, 23 Apr 2007 22:35:41 -0700
Newsgroups gmane.comp.lang.sml.smlnj
Message-ID <[email protected]>
On Apr 11, 2007, at 10:37 AM, Vesa A Norrman wrote:

> Perhaps the problem with malloc/free happens because they are in  
> different
> place than other dl-loaded functions. I mean they do not have to be
> dl-loaded.
>
> You can experiment by adding
>
> if (strcmp(symname, "malloc") == 0) addr = &malloc;
>
> in dlsym.c. Then it would not use dl-loading for those functions.
>
> Really, I don't know if that will make any difference (and I don't  
> have
> a mac too).


Actually malloc/free are NOT the problem.  It's the nlffi allocators/ 
deallocators which are the problem.  I can use malloc/free all day  
long and never see a crash.  That's what I do for some of the  
modules.  However, for some reason, which I just can't seem to  
remember, it's not practical to use them everywhere.  I'm not sure  
why not.

Interesting trick though, might come in handy some day during nlffi  
hacking :-)

Brian



> _______________________________________________
> Smlnj-list mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/smlnj-list


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/