Hi Alex! Sorry that I can't get it. Can you talk about it with more detail.
Without pointer operations, How can I get the data in the allocated
memory through the address returned to pawn?
Shouled I defina a native function to read wirte the memory like:
cell nativeArrayRead(address, index)
cell nativeArrayWrite(address,index,value)
some thing like that?
======== 2013-05-06 07:18:06 您在来信中写道: ========
Today's Topic Summary
Group:
http://groups.google.com/group/pawnscript/topics
native functions that returns arrays [1 Update]
Ternary operator using stupid stack sizes. [3 Updates]
native functions that returns arrays
Alex Cole <
yle...@gmail.com> May 05 09:32AM -0700
PAWN doesn't have pointers, but it does have addresses. I suspect you
allocate memory on the heap then return that address as a single cell from
the native.
Ternary operator using stupid stack sizes.
Alex Cole <
yle...@gmail.com> May 05 07:17AM -0700
OK, I've managed to produce a minimal test case:
#pragma tabsize 4
#pragma semicolon 1
#pragma ctrlchar '\\'
stock SomeFunction()
{
#if defined __COMPILER_SECOND_PASS
for (new loop = 1; loop; loop = (loop ? 0 : 1))
#endif
{
}
return 0;
}
main()
{
return SomeFunction() ? 0 : 1;
}
static stock __COMPILER_SECOND_PASS() {}
When I compile this with 3.2.3664 it gives excess heap allocations on the
final "return" of the code. When I compile this with 4.0.4733 I get:
Assertion Failed: result, function hier13, file sc3.c, line 1197.
ABNORMAL TERMINATION
Which does seem to confirm that there is a bug in heap allocation somewhere
and that it still exists. I don't have any other compilers compiled on
which to test.
Alex Cole <
yle...@gmail.com> May 05 07:22AM -0700
Actually, you don't even need the loop:
new gVar;
stock SomeFunction()
{
#if defined main
gVar = (gVar ? 0 : 1);
#endif
return 0;
}
main()
{
return SomeFunction() ? 0 : 1;
}
Alex Cole <
yle...@gmail.com> May 05 07:50AM -0700
Sorry, I can't figure out how to edit messages (probably as they're
emails). Just a note that I first reported this here:
http://forum.sa-mp.com/showpost.php?p=2508346
As I'm Y_Less from the SA:MP forums.
You received this message because you are subscribed to the Google Group pawnscript.
You can post via email.
To unsubscribe from this group, send an empty message.
For more options, visit this group.
--
You received this message because you are subscribed to the Google Groups "Pawn Scripting Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
pawnscript+...@googlegroups.com.
To post to this group, send email to
pawns...@googlegroups.com.
Visit this group at
http://groups.google.com/group/pawnscript?hl=en.
For more options, visit
https://groups.google.com/groups/opt_out.
= = = = = = = = = = = = = = = = = = = = = =
致
礼!
杨标(Vinge)
ven....@gmail.com
2013-05-06