aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/flext/source/flsupport.cpp
diff options
context:
space:
mode:
authorThomas Grill <xovo@users.sourceforge.net>2003-01-08 04:37:20 +0000
committerThomas Grill <xovo@users.sourceforge.net>2003-01-08 04:37:20 +0000
commit900871454af06db1d751e28cea56f59dc43d3c17 (patch)
treef0056d2f328953865d8882a6c8c5e3c673cf1254 /externals/grill/flext/source/flsupport.cpp
parentb8510c87be3a74307f4ad6122d75a353d350b84c (diff)
""
svn path=/trunk/; revision=328
Diffstat (limited to 'externals/grill/flext/source/flsupport.cpp')
-rw-r--r--externals/grill/flext/source/flsupport.cpp26
1 files changed, 22 insertions, 4 deletions
diff --git a/externals/grill/flext/source/flsupport.cpp b/externals/grill/flext/source/flsupport.cpp
index ec3b5ef7..f8717d02 100644
--- a/externals/grill/flext/source/flsupport.cpp
+++ b/externals/grill/flext/source/flsupport.cpp
@@ -57,7 +57,11 @@ void flext::Setup()
void *flext::operator new(size_t bytes)
{
bytes += sizeof(size_t);
- char *blk = (char *)getbytes(bytes);
+#if FLEXT_SYS == FLEXT_SYS_JMAX
+ char *blk = (char *)::fts_malloc(bytes);
+#else
+ char *blk = (char *)::getbytes(bytes);
+#endif
*(size_t *)blk = bytes;
return blk+sizeof(size_t);
}
@@ -66,7 +70,11 @@ void flext::operator delete(void *blk)
{
char *ori = (char *)blk-sizeof(size_t);
size_t bytes = *(size_t *)ori;
- freebytes(ori,bytes);
+#if FLEXT_SYS == FLEXT_SYS_JMAX
+ ::fts_free(ori);
+#else
+ ::freebytes(ori,bytes);
+#endif
}
void *flext::NewAligned(size_t bytes,int bitalign)
@@ -74,7 +82,11 @@ void *flext::NewAligned(size_t bytes,int bitalign)
const size_t ovh = sizeof(size_t)+sizeof(char *);
const unsigned long alignovh = bitalign/8-1;
bytes += ovh+alignovh;
- char *blk = (char *)getbytes(bytes);
+#if FLEXT_SYS == FLEXT_SYS_JMAX
+ char *blk = (char *)::fts_malloc(bytes);
+#else
+ char *blk = (char *)::getbytes(bytes);
+#endif
char *ablk = reinterpret_cast<char *>((reinterpret_cast<unsigned long>(blk)+ovh+alignovh) & ~alignovh);
*(char **)(ablk-sizeof(size_t)-sizeof(char *)) = blk;
*(size_t *)(ablk-sizeof(size_t)) = bytes;
@@ -85,11 +97,17 @@ void flext::FreeAligned(void *blk)
{
char *ori = *(char **)((char *)blk-sizeof(size_t)-sizeof(char *));
size_t bytes = *(size_t *)((char *)blk-sizeof(size_t));
- freebytes(ori,bytes);
+
+#if FLEXT_SYS == FLEXT_SYS_JMAX
+ ::fts_free(ori);
+#else
+ ::freebytes(ori,bytes);
+#endif
}
// ------------------------------------------
+//! \todo there is probably also a shortcut for Max and jMax
void flext::GetAString(const t_atom &a,char *buf,int szbuf)
{
#if FLEXT_SYS == FLEXT_SYS_PD