Use one's own malloc/free

44 views
Skip to first unread message

gmhwxi

unread,
Jan 4, 2014, 2:21:13 AM1/4/14
to ats-lan...@googlegroups.com

Here is an example showing a simple way to use user-defined malloc/free:

https://github.com/githwxi/ATS-Postiats/tree/master/doc/EXAMPLE/CA-HSR2/program-1-2

The flag  -DATS_MEMALLOC_USER indicates to the ATS compiler that the following
two functions are used for memory allocation/deallocation:

extern
void

*atsruntime_malloc_user (size_t bsz) ;

extern
void
atsruntime_mfree_user (void* ptr) ;


Reply all
Reply to author
Forward
0 new messages