18.04.2013, 14:49
(
Последний раз редактировалось Y_Less; 18.04.2013 в 19:09.
)
Quote:
Very crafty. Nice!
I'd suggest you make it so each library could tell y_malloc how much memory it wants, then it'd be added up and "stolen" on startup. That way each library could worry about its own, and get all the memory it wants. pawn Код:
|
Quote:
Benchmarks with the older version of `malloc`. Anyway, I think this is one is a little slower than the older one.
Can people allocate more memory than those "several Mb"? |
Edit: It turns out I missed something very important. Once I was done with the code I removed all the debug prints and it instantly stopped working! I'm still not 100% sure of the issue, but I think it might be this in amx.c:
pawn Код:
case OP_SYSREQ:
GETPARAM(offs);
/* save a few registers */
amx->cip=(cell)((unsigned char *)cip-amx->code);
amx->hea=hea;
amx->frm=frm;
amx->stk=stk;